Default registry username to Gitea actor
build-ci-image / image (push) Successful in 1m1s

This commit is contained in:
2026-05-02 18:03:22 +03:00
parent 95fb2f5ca0
commit 6413dba3ec
3 changed files with 33 additions and 13 deletions
+13 -1
View File
@@ -11,6 +11,8 @@ on:
env:
REGISTRY_HOST: git.neosisyphus.com
REGISTRY_IMAGE: git.neosisyphus.com/evol3d/evol-testbed
# Optional. If this secret is not set, the workflow uses GITHUB_ACTOR.
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
jobs:
image:
@@ -21,8 +23,18 @@ jobs:
- name: Log in to container registry
run: |
set -eu
username="${REGISTRY_USERNAME:-${GITHUB_ACTOR:-}}"
if [ -z "$username" ]; then
echo "REGISTRY_USERNAME secret is empty and GITHUB_ACTOR is not set" >&2
exit 1
fi
if [ -z "${{ secrets.REGISTRY_PASSWORD }}" ]; then
echo "REGISTRY_PASSWORD secret is empty. Set it to a Gitea access token with package write permission." >&2
exit 1
fi
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "$REGISTRY_HOST" \
-u "${{ secrets.REGISTRY_USERNAME }}" \
-u "$username" \
--password-stdin
- name: Build CI image