From 4630dde3679aff3c6ad6e51e46db95e76048ce22 Mon Sep 17 00:00:00 2001 From: wimby Date: Fri, 25 Sep 2026 21:02:34 +0200 Subject: [PATCH] ci: use dedicated registry token when configured --- .gitea/workflows/container.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/container.yml b/.gitea/workflows/container.yml index 060561f6..d8484ba7 100644 --- a/.gitea/workflows/container.yml +++ b/.gitea/workflows/container.yml @@ -54,10 +54,14 @@ jobs: - name: Log in to Gitea registry shell: bash env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | set -euo pipefail - echo "${GITEA_TOKEN}" | docker login git.wimby.cz --username "${GITHUB_ACTOR}" --password-stdin + if [ -z "${REGISTRY_TOKEN:-}" ]; then + echo "REGISTRY_TOKEN is not configured; image will build but publishing is skipped." + exit 0 + fi + echo "${REGISTRY_TOKEN}" | docker login git.wimby.cz --username wimby --password-stdin - name: Build image shell: bash @@ -75,8 +79,14 @@ jobs: - name: Push image shell: bash + env: + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | set -euo pipefail + if [ -z "${REGISTRY_TOKEN:-}" ]; then + echo "REGISTRY_TOKEN is not configured; skipping publish." + exit 0 + fi short_sha="${GITHUB_SHA:0:12}" docker push "git.wimby.cz/wimby/tubesync:${short_sha}" docker push "git.wimby.cz/wimby/tubesync:latest"