Update .gitea/workflows/build-image.yml
This commit is contained in:
		@@ -2,10 +2,6 @@ name: Image Build
 | 
			
		||||
 | 
			
		||||
on: [push]
 | 
			
		||||
 | 
			
		||||
# on:
 | 
			
		||||
  # schedule:
 | 
			
		||||
  #   - cron: '0 0 * * *' # run daily
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  init:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
@@ -17,12 +13,13 @@ jobs:
 | 
			
		||||
        run: |
 | 
			
		||||
          sudo apt-get update
 | 
			
		||||
          sudo apt-get install jq -y
 | 
			
		||||
 | 
			
		||||
          
 | 
			
		||||
      - name: get latest versions
 | 
			
		||||
        id: iventoy
 | 
			
		||||
        run: |
 | 
			
		||||
          version=$(curl -s https://api.github.com/repos/ventoy/PXE/releases/latest | grep "tag_name" | cut -d'"' -f4)
 | 
			
		||||
          echo "version=${version#'v'}" >> $GITHUB_OUTPUT
 | 
			
		||||
          echo "version=${version#'v'}" >> iventoy_output.txt
 | 
			
		||||
          echo "::set-output name=version::${version#'v'}"          
 | 
			
		||||
 | 
			
		||||
      - name: Check labels of the latest image on Docker Hub
 | 
			
		||||
        id: buildOrNot
 | 
			
		||||
@@ -32,7 +29,8 @@ jobs:
 | 
			
		||||
          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
 | 
			
		||||
          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
 | 
			
		||||
@@ -43,7 +41,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "Checkout repository"
 | 
			
		||||
          echo "Checkout repository"          
 | 
			
		||||
      - name: Login to Docker Hub
 | 
			
		||||
        run: |
 | 
			
		||||
          docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user