1 Commits
1.0.2 ... 1.0.3

View File

@@ -16,10 +16,19 @@ jobs:
REGISTRY: hub.realmanual.ru REGISTRY: hub.realmanual.ru
IMAGE_NAME: pub/sqlite-backup/backup IMAGE_NAME: pub/sqlite-backup/backup
steps: steps:
- name: Checkout - name: Checkout (git)
uses: actions/checkout@v4 shell: bash
with: env:
fetch-depth: 0 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: Extract tag
id: vars id: vars
@@ -28,22 +37,24 @@ jobs:
TAG_REF="${GITHUB_REF#refs/tags/}" TAG_REF="${GITHUB_REF#refs/tags/}"
echo "tag=$TAG_REF" >> "$GITHUB_OUTPUT" echo "tag=$TAG_REF" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx - name: Docker login
uses: docker/setup-buildx-action@v3 shell: bash
run: |
set -euo pipefail
echo "${{ secrets.GITEA_TOKEN }}" | docker login "${{ env.REGISTRY }}" --username "${{ github.actor }}" --password-stdin
- name: Log in to registry - name: Build image
uses: docker/login-action@v3 shell: bash
with: run: |
registry: ${{ env.REGISTRY }} set -euo pipefail
username: ${{ github.actor }} docker build \
password: ${{ secrets.GITEA_TOKEN }} -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}" \
-t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" \
.
- name: Build and push - name: Push images
uses: docker/build-push-action@v6 shell: bash
with: run: |
context: . set -euo pipefail
push: true docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}"
platforms: linux/amd64 docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest