changed skopeo caching

This commit is contained in:
gunnar
2026-06-06 19:16:35 +02:00
parent 8b9ce4b100
commit 8f5cebb3ea
+12 -6
View File
@@ -104,25 +104,31 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }} tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }} labels: ${{ steps.metadata.outputs.labels }}
- name: Push Image via Skopeo (Convert to OCI via Archive) - name: Push Image via Skopeo (Optimized Archive)
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
env: env:
GENERATED_TAGS: ${{ steps.metadata.outputs.tags }} GENERATED_TAGS: ${{ steps.metadata.outputs.tags }}
run: | run: |
for tag in $GENERATED_TAGS; do # Die mehrzeiligen Tags in ein Bash-Array umwandeln
echo "Saving $tag to temporary tarball..." TAG_LIST=($GENERATED_TAGS)
docker save "$tag" -o image.tar FIRST_TAG=${TAG_LIST[0]}
echo "Saving image ONCE via $FIRST_TAG to temporary tarball..."
docker save "$FIRST_TAG" -o image.tar
# Jetzt loopen wir NUR den Upload-Schritt über dieselbe Datei
for tag in "${TAG_LIST[@]}"; do
echo "Pushing and converting $tag to clean OCI format..." echo "Pushing and converting $tag to clean OCI format..."
skopeo copy \ skopeo copy \
--format oci \ --format oci \
--dest-creds "${{ github.repository_owner }}:${{ secrets.REGISTRY }}" \ --dest-creds "${{ github.repository_owner }}:${{ secrets.REGISTRY }}" \
docker-archive:image.tar \ docker-archive:image.tar \
docker://$tag docker://$tag
rm -f image.tar
done done
# Am Ende sauber aufräumen
rm -f image.tar
- name: Install envsubst dependencies - name: Install envsubst dependencies
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
run: | run: |