ci: use dedicated registry token when configured
Some checks failed
Build TubeSync image / container (push) Failing after 2m7s
Some checks failed
Build TubeSync image / container (push) Failing after 2m7s
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user