From 9b6424ec7c0c37bc25563e0f46786b82c6b6050b Mon Sep 17 00:00:00 2001 From: gunnar Date: Sat, 30 May 2026 16:14:30 +0200 Subject: [PATCH] fix: replace Skopeo push with redhat-actions/push-to-registry Avoids double compression (chunkah zstd + Skopeo zstd:chunked). push-to-registry handles auth and multi-tag push natively. --- .github/workflows/build.yml | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcd0fe3..0148927 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,29 +127,20 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # OPTIMIERUNG 2: Skopeo zwingen, die Layer intelligent zu zerteilen - - name: Push to GHCR via Skopeo (with intelligent zstd:chunked rechunking) + - name: Push to GHCR + if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ env.IMAGE_NAME }} + tags: ${{ steps.metadata.outputs.tags }} + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get registry digest if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) run: | - set -x - - export REGISTRY_AUTH_FILE=$HOME/.docker/config.json - REGISTRY_PATH="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}" - - # "zstd:chunked" mit Feineinstellung zwingt Skopeo, Pakete anhand ihrer - # Metadaten (sofern vorhanden) in reproduzierbare Chunks zu brechen. - podman unshare bash -c " - for tag in ${{ steps.metadata.outputs.tags }}; do - skopeo copy \ - --dest-compress-format=zstd:chunked \ - --dest-compress-level=5 \ - --dest-oci-accept-uncompressed-layers \ - containers-storage:localhost/${{ env.IMAGE_NAME }}:${{ env.DEFAULT_TAG }} \ - docker://$REGISTRY_PATH:\$tag - done - " - - FINAL_REGISTRY_DIGEST=$(skopeo inspect docker://$REGISTRY_PATH:${{ env.DEFAULT_TAG }} --format '{{.Digest}}') + FINAL_REGISTRY_DIGEST=$(skopeo inspect docker://${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEFAULT_TAG }} --format '{{.Digest}}') echo "REGISTRY_DIGEST=$FINAL_REGISTRY_DIGEST" >> $GITHUB_ENV - name: Install Cosign