From d58101287d867c44024c4a3f747b7498006828bd Mon Sep 17 00:00:00 2001 From: Overlord Date: Tue, 13 Oct 2026 16:59:39 +0200 Subject: [PATCH] Update Gitea workflows to use `REGISTRY_USER` and `REGISTRY_TOKEN` for registry login, falling back to `GITEA_TOKEN` when secrets are unavailable. --- .gitea/workflows/images.yml | 19 +++++++++++-------- README.md | 5 +++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/images.yml b/.gitea/workflows/images.yml index 7aaadc4..4e0e5bd 100644 --- a/.gitea/workflows/images.yml +++ b/.gitea/workflows/images.yml @@ -1,3 +1,6 @@ +# Builds the images and pushes them to the registry of the organization. +# Uses the secrets REGISTRY_USER and REGISTRY_TOKEN (a token with package +# write access) when they exist, else the automatic token of the run. name: images on: @@ -27,8 +30,8 @@ jobs: - name: Log in to the registry run: > - echo "${{ secrets.GITEA_TOKEN }}" - | docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin + echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}" + | docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin - name: Build and push run: | @@ -44,8 +47,8 @@ jobs: - name: Log in to the registry run: > - echo "${{ secrets.GITEA_TOKEN }}" - | docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin + echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}" + | docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin - name: Build and push run: | @@ -61,8 +64,8 @@ jobs: - name: Log in to the registry run: > - echo "${{ secrets.GITEA_TOKEN }}" - | docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin + echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}" + | docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin - name: Build and push run: | @@ -78,8 +81,8 @@ jobs: - name: Log in to the registry run: > - echo "${{ secrets.GITEA_TOKEN }}" - | docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin + echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}" + | docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin - name: Build and push run: | diff --git a/README.md b/README.md index a30b642..3c6c0e6 100644 --- a/README.md +++ b/README.md @@ -185,8 +185,9 @@ corepack pnpm test Node runs the TypeScript sources directly. Gitea Actions checks every push to `develop` and `master` and builds the images `homepage-sandbox`, `homepage-spawner`, `homepage-backend` and `homepage-jobs`, tagged with the -commit and the branch. It logs in to the registry with the automatic token -of each run, so it needs no secrets. +commit and the branch. It logs in to the registry with the secrets +`REGISTRY_USER` and `REGISTRY_TOKEN` (a token with package write access) +when they exist, and otherwise with the automatic token of the run. ## License