Update .gitea/workflows/build-image.yml
This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
name: Image Build
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
on: [push]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  init:
 | 
			
		||||
@@ -28,10 +27,14 @@ jobs:
 | 
			
		||||
          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)
 | 
			
		||||
          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"
 | 
			
		||||
          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)
 | 
			
		||||
          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 "Latest label: $latest"
 | 
			
		||||
          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")"
 | 
			
		||||
 | 
			
		||||
  docker:
 | 
			
		||||
    name: iventoy image
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user