From 72bac2d644099795feb8cd145c4b3c8a4d7b80a0 Mon Sep 17 00:00:00 2001 From: SubQ Date: Sun, 6 Dec 2026 07:19:56 +0300 Subject: [PATCH] Publish images with the organization registry token --- .gitea/workflows/build.yml | 14 ++++++++++---- README.md | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2019475..d31dc2f 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -21,6 +21,12 @@ permissions: jobs: build: runs-on: ubuntu-latest + # The Actions token is not accepted by the container registry, so the push + # uses a PAT. REGISTRY_USER / REGISTRY_TOKEN (a repository variable and + # secret) override the organization release-bot defaults. + env: + REGISTRY_USER: ${{ vars.REGISTRY_USER || 'echoion-release-bot' }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN || secrets.RELEASE_BOT_TOKEN }} strategy: fail-fast: false matrix: @@ -44,13 +50,13 @@ jobs: printf 'ref=%s/%s:%s\n' "$server" "$repo" "${{ matrix.image }}" >>"$GITHUB_OUTPUT" - name: Log in to the Gitea container registry - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && env.REGISTRY_TOKEN != '' shell: bash run: | set -euo pipefail - printf '%s' "${{ github.token }}" | + printf '%s' "$REGISTRY_TOKEN" | docker login "${{ steps.image.outputs.registry }}" \ - -u "${{ github.actor }}" --password-stdin + -u "$REGISTRY_USER" --password-stdin - name: Build shell: bash @@ -70,7 +76,7 @@ jobs: xvfb-run -a env VK_DRIVER_FILES="$icd" vulkaninfo --summary' - name: Push - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && env.REGISTRY_TOKEN != '' shell: bash run: | set -euo pipefail diff --git a/README.md b/README.md index c4a2fc8..5d2704b 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,14 @@ GPU). Without a GPU, request the software driver explicitly: VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json vulkaninfo --summary ``` +## Publishing + +A push to `main` builds every image and pushes it to the registry. The +container registry does not accept the Actions job token, so the workflow logs +in with the organization `RELEASE_BOT_TOKEN` as `echoion-release-bot`. Set the +repository variable `REGISTRY_USER` and secret `REGISTRY_TOKEN` to use a +dedicated account instead. + ## Adding an image 1. Add `images//Dockerfile`.