refactor: add preflight registry check and basic auth probe steps
Some checks failed
Build and Push Docker Image / docker (push) Failing after 5s
Some checks failed
Build and Push Docker Image / docker (push) Failing after 5s
This commit is contained in:
@@ -125,6 +125,26 @@ jobs:
|
|||||||
echo "image_full=$IMAGE_FULL" >> "$GITHUB_OUTPUT"
|
echo "image_full=$IMAGE_FULL" >> "$GITHUB_OUTPUT"
|
||||||
echo "tag_args=$TAG_ARGS" >> "$GITHUB_OUTPUT"
|
echo "tag_args=$TAG_ARGS" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Preflight registry check
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ steps.vars.outputs.registry }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
echo "Probing https://$REGISTRY/v2/"
|
||||||
|
apk add --no-cache curl >/dev/null 2>&1 || true
|
||||||
|
curl -sSI "https://$REGISTRY/v2/" | awk '/HTTP\// || /WWW-Authenticate:/ || /Docker-Distribution-Api-Version:/' || true
|
||||||
|
|
||||||
|
- name: Registry auth probe (basic)
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ steps.vars.outputs.registry }}
|
||||||
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
apk add --no-cache curl >/dev/null 2>&1 || true
|
||||||
|
USER_NAME="${REGISTRY_USERNAME:-$GITHUB_ACTOR}"
|
||||||
|
CODE=$(curl -sS -u "$USER_NAME:${{ secrets.GITEA_TOKEN }}" -o /dev/null -w "%{http_code}" "https://$REGISTRY/v2/") || CODE=000
|
||||||
|
echo "Basic auth probe to https://$REGISTRY/v2/ returned HTTP $CODE"
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry
|
||||||
env:
|
env:
|
||||||
REGISTRY: ${{ steps.vars.outputs.registry }}
|
REGISTRY: ${{ steps.vars.outputs.registry }}
|
||||||
|
|||||||
Reference in New Issue
Block a user