added step to get registry token

This commit is contained in:
Brian Bjarke Jensen
2025-10-03 23:47:00 +02:00
parent 0c8ea42b74
commit d83df74763
+12 -1
View File
@@ -23,6 +23,17 @@ jobs:
env:
CI_RUNNER_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }}
run: |
# Get a bearer token for authentication
REGISTRY_TOKEN=$(curl -s -X GET \
-u "${{ gitea.actor }}:${{ secrets.CI_RUNNER_TOKEN }}" \
"https://gitea.gt-proj.com/v2/token?service=container_registry&scope=repository:brian/mlflow-full:pull" \
| jq -r '.token // empty')
if [ -z "$REGISTRY_TOKEN" ]; then
echo "digest_found=false" >> $GITHUB_OUTPUT
echo "Failed to obtain registry token"
exit 1
fi
# Inspect the manifest of the MLflow-full image
MANIFEST=$(docker manifest inspect "gitea.gt-proj.com/brian/mlflow-full:latest" 2>/dev/null || echo "{}")
if [ "$MANIFEST" == "{}" ]; then
echo "digest_found=false" >> $GITHUB_OUTPUT
@@ -38,7 +49,7 @@ jobs:
fi
# Get the manifest for the specific platform
PLATFORM_MANIFEST=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
-H "Authorization: Bearer $CI_RUNNER_TOKEN" \
-H "Authorization: Bearer $REGISTRY_TOKEN" \
"https://gitea.gt-proj.com/v2/brian/mlflow-full/manifests/$DIGEST" 2>/dev/null || echo "{}")
if [ "$PLATFORM_MANIFEST" == "{}" ]; then
echo "digest_found=false" >> $GITHUB_OUTPUT