|
80 | 80 | maintainer=techprimate GmbH <[email protected]> |
81 | 81 | cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.platform.tag }} |
82 | 82 | cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.platform.tag }},mode=max |
83 | | - outputs: type=image,name=docker.io/${{ github.repository }},name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} |
| 83 | + outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} |
84 | 84 |
|
85 | 85 | - name: Export digest |
86 | 86 | if: github.event_name != 'pull_request' |
@@ -157,33 +157,21 @@ jobs: |
157 | 157 | - name: Create manifest list and push |
158 | 158 | working-directory: /tmp/digests |
159 | 159 | run: | |
160 | | - # Extract all tags |
161 | | - image_tags=$(printf '%s' "$DOCKER_METADATA_OUTPUT_JSON" | jq -cr '.tags | map("-t " + .) | join(" ")') |
162 | | - echo "Creating manifest list with tags: $image_tags" |
163 | | -
|
164 | | - # We need to create separate manifests for each registry |
165 | | - # because the digests are registry-specific |
166 | | -
|
167 | | - # For each registry, create manifest with its digests |
168 | | - for registry in "docker.io/${{ github.repository }}" "ghcr.io/${{ github.repository }}"; do |
169 | | - echo "Processing registry: $registry" |
170 | | -
|
171 | | - # Get tags for this registry |
172 | | - registry_tags=$(printf '%s' "$DOCKER_METADATA_OUTPUT_JSON" | jq -cr --arg registry "$registry" '.tags | map(select(startswith($registry))) | map("-t " + .) | join(" ")') |
173 | | -
|
174 | | - # Build digest references for this registry |
175 | | - digest_refs="" |
176 | | - for digest_file in *; do |
177 | | - digest_refs="$digest_refs ${registry}@sha256:${digest_file}" |
178 | | - done |
179 | | -
|
180 | | - echo "Tags for $registry: $registry_tags" |
181 | | - echo "Digest refs: $digest_refs" |
182 | | -
|
183 | | - # Create and push manifest for this registry |
184 | | - docker buildx imagetools create $registry_tags $digest_refs |
| 160 | + # Build digest references from GHCR (where images were pushed) |
| 161 | + digest_refs="" |
| 162 | + for digest_file in *; do |
| 163 | + digest_refs="$digest_refs ghcr.io/${{ github.repository }}@sha256:${digest_file}" |
185 | 164 | done |
186 | | -
|
| 165 | + echo "Digest references: $digest_refs" |
| 166 | + |
| 167 | + # Get all tags (both GHCR and Docker Hub) |
| 168 | + all_tags=$(printf '%s' "$DOCKER_METADATA_OUTPUT_JSON" | jq -cr '.tags | map("-t " + .) | join(" ")') |
| 169 | + echo "Creating manifest list with tags: $all_tags" |
| 170 | + |
| 171 | + # Create manifest list with all tags (GHCR and Docker Hub) |
| 172 | + # This will create the manifest in GHCR and simultaneously tag/push to Docker Hub |
| 173 | + docker buildx imagetools create $all_tags $digest_refs |
| 174 | + |
187 | 175 | # Inspect the first tag for verification |
188 | 176 | first_tag=$(printf '%s' "$DOCKER_METADATA_OUTPUT_JSON" | jq -cr '.tags[0]') |
189 | 177 | docker buildx imagetools inspect "$first_tag" |
0 commit comments