@@ -155,7 +155,6 @@ jobs:
155155 labels : ${{ steps.meta.outputs.labels }}
156156 annotations : ${{ steps.meta.outputs.annotations }}
157157 push : ${{ !inputs.dry_run }}
158- load : true
159158 platforms : ${{ inputs.platforms }}
160159 cache-from : type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
161160 cache-to : type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},mode=max
@@ -195,15 +194,22 @@ jobs:
195194 sarif_file : ${{ steps.scan.outputs.sarif }}
196195 category : build-${{ inputs.image }}
197196
198- - name : Show all image tags for debugging
199- run : echo "${{ steps.meta.outputs.tags }}"
200-
201- - name : Save the image as tarball
197+ - name : Export and upload images for all platforms
202198 run : |
203- docker save -o ${{ inputs.image }}.tar localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }}
204-
205- - name : Upload the image artifact
199+ # Remove spaces and split platforms by comma
200+ platforms=$(echo "${{ inputs.platforms }}" | tr -d ' ' | tr ',' ' ')
201+ for platform in $platforms; do
202+ # Replace / with - for tarball name (e.g., linux/amd64 -> linux-amd64)
203+ plat_tag=$(echo "$platform" | tr '/' '-')
204+ # Create a local reference for the platform
205+ docker buildx imagetools create --tag tempimg-$plat_tag ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} --platform $platform
206+ # Export the image as a tarball
207+ docker buildx imagetools export tempimg-$plat_tag > ${{ inputs.image }}-$plat_tag.tar
208+ done
209+
210+ - name : Upload all image artifacts
206211 uses : actions/upload-artifact@v4
207212 with :
208- name : ${{ inputs.image }}
209- path : ${{ inputs.image }}.tar
213+ name : ${{ inputs.image }}-images
214+ path : ${{ inputs.image }}-*.tar
215+
0 commit comments