Enhance Docker build workflow with registry token validation
All checks were successful
CI / ci (push) Successful in 15s
CI / ci (pull_request) Successful in 14s

- Added a check in docker-build.yml to ensure the REGISTRY_TOKEN is set before attempting to log in to the Gitea Container Registry.
- Included an error message to guide users in adding the necessary secret for successful authentication.
This commit is contained in:
2026-02-07 18:14:44 +03:00
parent 7347b4c042
commit 9fa0a78eb6

View File

@@ -28,8 +28,13 @@ jobs:
run: |
echo "host=${GITHUB_SERVER_URL#https://}" >> $GITHUB_OUTPUT
# REGISTRY_TOKEN: Personal Access Token с правом write:package (или токен из Package Registry)
- name: Log in to Gitea Container Registry
run: |
if [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then
echo "::error::REGISTRY_TOKEN не задан. Добавьте секрет с токеном (scope: write:package)."
exit 1
fi
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ steps.registry.outputs.host }} -u ${{ github.actor }} --password-stdin
- name: Build and push