diff --git a/.github/actions/build-image/action.yml b/.github/actions/build-image/action.yml index 173e6de1..5ce36c2f 100644 --- a/.github/actions/build-image/action.yml +++ b/.github/actions/build-image/action.yml @@ -47,5 +47,5 @@ runs: --cache-from "${repo}:${{ inputs.tag }}" \ --image-name "${repo}:${{ inputs.tag }}" \ --workspace-folder "$(realpath -m ./image)" \ - --output "type=oci,dest=${{ runner.temp }}/${{ inputs.arch }}.tar" \ + --output "type=docker,dest=${{ runner.temp }}/${{ inputs.arch }}.tar" \ ; diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index 15bb9ae5..38199b42 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -65,7 +65,7 @@ jobs: with: persist-credentials: false - name: Free up disk space + - name: Free up disk space uses: ./.github/actions/free-disk-space with: tool_cache: "${{ runner.tool_cache }}" @@ -95,12 +95,12 @@ jobs: hashes=(); for arch in "amd64" "arm64"; do - # Load the linux/$arch image with the final name - docker import --platform "linux/${arch}" "${{ runner.temp }}/${arch}.tar" ${name}; - # Push the local image to the registry to get its remote hash - hash="$(docker push ${name} | tail -n1 | cut -d' ' -f3)"; - # Save the remote hash for use below - hashes+=("$hash"); + # Load the linux/$arch and tag the loaded image with the final name + docker image tag \ + $(docker load --input "${{ runner.temp }}/${arch}.tar" | tail -n1 | cut -d' ' -f3) \ + ${name}; + # Push the local image to the registry to get its remote hash and save the remote hash for use below + hashes+=("$(docker push ${name} | tail -n1 | cut -d' ' -f3)"); done # Create and push the multiarch manifest