diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 15c0b0f1..60d314b0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -43,12 +43,12 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log into registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push id: build uses: docker/build-push-action@v6 @@ -124,10 +124,21 @@ jobs: working-directory: /tmp/digests shell: bash run: | + shopt -s nullglob + references=() + for digest in *; do + references+=("${IMAGE}@sha256:${digest}") + done + + if [ ${#references[@]} -eq 0 ]; then + echo "No digests found in /tmp/digests" >&2 + exit 1 + fi + docker buildx imagetools create \ -t "${IMAGE}:${VERSION}" \ -t "${IMAGE}:latest" \ - $(printf '%s@sha256:%s ' "${IMAGE}" *) + "${references[@]}" - name: Inspect image run: docker buildx imagetools inspect "${IMAGE}:${VERSION}"