Update .gitea/workflows/build-image.yml
This commit is contained in:
parent
542dda58a8
commit
b1dfb10ffb
@ -21,27 +21,27 @@ jobs:
|
|||||||
echo "version=${version#'v'}" >> iventoy_output.txt
|
echo "version=${version#'v'}" >> iventoy_output.txt
|
||||||
echo "::set-output name=version::${version#'v'}"
|
echo "::set-output name=version::${version#'v'}"
|
||||||
|
|
||||||
- name: Check labels of the latest image on Docker Hub
|
# - name: Check labels of the latest image on Docker Hub
|
||||||
id: buildOrNot
|
# id: buildOrNot
|
||||||
run: |
|
# run: |
|
||||||
repo=${1:-$GITEA_REPO}
|
# repo=${1:-$GITEA_REPO}
|
||||||
tag=${2:-latest}
|
# tag=${2:-latest}
|
||||||
token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
|
# token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
|
||||||
manifest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s "https://registry-1.docker.io/v2/${repo}/manifests/${tag}")
|
# manifest=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $token" -s "https://registry-1.docker.io/v2/${repo}/manifests/${tag}")
|
||||||
echo "Manifest response:"
|
# echo "Manifest response:"
|
||||||
echo "$manifest"
|
# echo "$manifest"
|
||||||
digest=$(echo "$manifest" | jq -r .config.digest)
|
# digest=$(echo "$manifest" | 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)
|
# 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 "Latest label: $latest"
|
# echo "Latest label: $latest"
|
||||||
echo "buildOrNot=$([ "$latest" != "$GITEA_IVENTOY" ] && echo "true" || echo "$GITEA_FORCE_BUILD")" >> iventoy_output.txt
|
# echo "buildOrNot=$([ "$latest" != "$GITEA_IVENTOY" ] && echo "true" || echo "$GITEA_FORCE_BUILD")" >> iventoy_output.txt
|
||||||
echo "::set-output name=buildOrNot::$([ "$latest" != "$GITEA_IVENTOY" ] && echo "true" || echo "$GITEA_FORCE_BUILD")"
|
# echo "::set-output name=buildOrNot::$([ "$latest" != "$GITEA_IVENTOY" ] && echo "true" || echo "$GITEA_FORCE_BUILD")"
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: iventoy image
|
name: iventoy image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- init
|
- init
|
||||||
if: ${{ needs.init.outputs.buildOrNot == 'true' }}
|
# if: ${{ needs.init.outputs.buildOrNot == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user