Update .gitea/workflows/build-and-push.yaml
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 2s

This commit is contained in:
2026-05-11 07:46:09 +00:00
parent aa7c39bd53
commit 652e738681

View File

@@ -47,9 +47,26 @@ jobs:
- name: Login to Gitea registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login \
REGISTRY_USERNAME="${{ secrets.REGISTRY_USERNAME }}"
REGISTRY_TOKEN="${{ secrets.REGISTRY_TOKEN }}"
if [ -z "${REGISTRY_USERNAME}" ]; then
REGISTRY_USERNAME="${{ gitea.actor }}"
fi
if [ -z "${REGISTRY_USERNAME}" ]; then
echo "Registry username is missing. Set REGISTRY_USERNAME or run the workflow with a valid Gitea actor."
exit 1
fi
if [ -z "${REGISTRY_TOKEN}" ]; then
echo "Registry token is missing. Set REGISTRY_TOKEN as a repository or organization secret."
exit 1
fi
echo "${REGISTRY_TOKEN}" | docker login \
"${{ steps.meta.outputs.registry_host }}" \
--username "${{ secrets.REGISTRY_USERNAME }}" \
--username "${REGISTRY_USERNAME}" \
--password-stdin
- name: Build image