4 Commits
1.0.3 ... 1.0.7

View File

@@ -11,50 +11,31 @@ permissions:
jobs: jobs:
build: build:
name: Build image
runs-on: dind runs-on: dind
env: container: ghcr.io/catthehacker/ubuntu:act-latest
REGISTRY: hub.realmanual.ru
IMAGE_NAME: pub/sqlite-backup/backup
steps: steps:
- name: Checkout (git) - name: Checkout repository
shell: bash uses: actions/checkout@v4
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
set -euo pipefail
: "${GITHUB_SERVER_URL:?}"
: "${GITHUB_REPOSITORY:?}"
: "${GITHUB_SHA:?}"
git init .
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
git -c http.extraHeader="Authorization: Bearer ${TOKEN}" fetch --no-tags --depth=1 origin "${GITHUB_SHA}"
git checkout --detach "${GITHUB_SHA}"
- name: Extract tag - name: Log in to the Container registry
id: vars uses: docker/login-action@v3
shell: bash with:
run: | registry: hub.realmanual.ru
TAG_REF="${GITHUB_REF#refs/tags/}" username: ${{ gitea.actor }}
echo "tag=$TAG_REF" >> "$GITHUB_OUTPUT" password: ${{ secrets.PUSH_TOKEN }}
- name: Docker login - name: Extract metadata (tags, labels) for
shell: bash id: meta
run: | uses: docker/metadata-action@v5
set -euo pipefail with:
echo "${{ secrets.GITEA_TOKEN }}" | docker login "${{ env.REGISTRY }}" --username "${{ github.actor }}" --password-stdin images: ${{ gitea.repository }}
- name: Build image - name: Build and push Docker image
shell: bash id: push
run: | uses: docker/build-push-action@v6
set -euo pipefail with:
docker build \ context: .
-t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}" \ push: true
-t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" \ tags: ${{ steps.meta.outputs.tags }}
. labels: ${{ steps.meta.outputs.labels }}
- name: Push images
shell: bash
run: |
set -euo pipefail
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}"
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"