From bf8fef91906f91b6b802d5eeb414999a74078736 Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Thu, 30 Jul 2026 11:50:38 +0200 Subject: [PATCH] ci: push to GHCR from the Gitea workflow instead of a separate one The Gitea instance's act_runner is the CI that actually executes here; GitHub Actions on the mirror isn't confirmed to run at all (and a push-mirror lacking the "workflow" PAT scope can silently drop .github/workflows changes anyway). Add a GHCR login/push to the existing .gitea/workflows/docker-publish.yml job instead, so one build produces tags on both the Gitea registry and ghcr.io. Drop the now-redundant .github/workflows/docker-publish.yml. Requires a new repo secret GHCR_TOKEN: a GitHub PAT with write:packages scope (separate from REGISTRY_TOKEN, which is scoped to the Gitea registry). --- .gitea/workflows/docker-publish.yml | 9 +++++++ .github/workflows/docker-publish.yml | 37 ---------------------------- 2 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/docker-publish.yml diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml index 7853788..13eff11 100644 --- a/.gitea/workflows/docker-publish.yml +++ b/.gitea/workflows/docker-publish.yml @@ -27,6 +27,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.REGISTRY_TOKEN }} + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Build and push uses: docker/build-push-action@v6 with: @@ -35,3 +42,5 @@ jobs: tags: | ${{ vars.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest ${{ vars.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ github.sha }} + ghcr.io/${{ env.IMAGE_NAME }}:latest + ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 354ef99..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Publish Docker image - -on: - push: - branches: [main, master] - tags: ['v*'] - -permissions: - contents: read - packages: write - -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: docker/setup-buildx-action@v3 - - - name: Compute lowercase image name - run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - - - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - ghcr.io/${{ env.IMAGE_NAME }}:latest - ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}