fix: enhance Gitea registry login step to handle empty secrets
Some checks failed
Build And Publish Production Image / Build And Publish Production Image (push) Failing after 27s

This commit is contained in:
2026-03-27 16:50:50 -03:00
parent af391efa89
commit 2072dd299d

View File

@@ -27,7 +27,21 @@ jobs:
run: docker build -t condado-newsletter:latest -f Dockerfile.allinone . run: docker build -t condado-newsletter:latest -f Dockerfile.allinone .
- name: Log in to Gitea container registry - name: Log in to Gitea container registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${REGISTRY} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin run: |
REGISTRY_USERNAME="${{ secrets.REGISTRY_USERNAME }}"
REGISTRY_PASSWORD="${{ secrets.REGISTRY_PASSWORD }}"
if [ -z "$REGISTRY_USERNAME" ]; then
REGISTRY_USERNAME="${{ github.actor }}"
echo "REGISTRY_USERNAME secret is empty; falling back to github.actor: $REGISTRY_USERNAME"
fi
if [ -z "$REGISTRY_PASSWORD" ]; then
echo "REGISTRY_PASSWORD secret is empty; cannot log in to ${REGISTRY}."
exit 1
fi
echo "$REGISTRY_PASSWORD" | docker login ${REGISTRY} -u "$REGISTRY_USERNAME" --password-stdin
- name: Tag registry images - name: Tag registry images
run: | run: |