Update .gitea/workflows/build-image.yml
Some checks failed
Image Build / init (push) Failing after 9s
Image Build / iventoy image (push) Has been skipped

This commit is contained in:
Sthope 2024-04-23 19:56:03 +02:00
parent 2fcb95971f
commit f4bd528372

View File

@ -24,15 +24,15 @@ jobs:
version=$(curl -s https://api.github.com/repos/ventoy/PXE/releases/latest | grep "tag_name" | cut -d'"' -f4)
echo "version=${version#'v'}" >> $GITHUB_OUTPUT
# - name: Check labels of the latest image on Docker Hub
# id: buildOrNot
# run: |
# repo=${1:-$GITEA_REPO}
# tag=${2:-latest}
# token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
# digest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s "https://registry-1.docker.io/v2/${repo}/manifests/${tag}" | jq -r .config.digest)
# latest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s -L "https://registry-1.docker.io/v2/${repo}/blobs/${digest}" | jq . | grep -Ew "IVENTOY" | cut -d'"' -f4)
# echo "buildOrNot=$([ $latest != '$GITEA_IVENTOY' ] && echo "true" || echo "$GITEA_FORCE_BUILD")" >> $GITHUB_OUTPUT
- name: Check labels of the latest image on Docker Hub
id: buildOrNot
run: |
repo=${1:-$GITEA_REPO}
tag=${2:-latest}
token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
digest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s "https://registry-1.docker.io/v2/${repo}/manifests/${tag}" | jq -r .config.digest)
latest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s -L "https://registry-1.docker.io/v2/${repo}/blobs/${digest}" | jq . | grep -Ew "IVENTOY" | cut -d'"' -f4)
echo "buildOrNot=$([ $latest != '$GITEA_IVENTOY' ] && echo "true" || echo "$GITEA_FORCE_BUILD")" >> $GITHUB_OUTPUT
docker:
name: iventoy image