@@ -54,13 +54,27 @@ jobs:
54
54
with :
55
55
platforms : linux/${{ matrix.platform }}
56
56
context : .
57
- push : true
58
- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-${{ matrix.platform }}
57
+ outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
59
58
labels : ${{ steps.meta.outputs.labels }}
60
59
allow : security.insecure
61
60
cache-from : type=gha,url=http://127.0.0.1:49160/
62
61
cache-to : type=gha,url=http://127.0.0.1:49160/,mode=max
63
62
63
+ - name : Export digest
64
+ run : |
65
+ mkdir -p /tmp/digests
66
+ digest="${{ steps.build.outputs.digest }}"
67
+ touch "/tmp/digests/${digest#sha256:}"
68
+
69
+ - name : Upload digest
70
+ uses : actions/upload-artifact@v4
71
+ with :
72
+ name : digests-${{ env.PLATFORM_PAIR }}
73
+ path : /tmp/digests/*
74
+ if-no-files-found : error
75
+ retention-days : 1
76
+
77
+
64
78
manifest :
65
79
66
80
needs : build
@@ -76,15 +90,25 @@ jobs:
76
90
username : ${{ github.actor }}
77
91
password : ${{ secrets.GITHUB_TOKEN }}
78
92
79
- - name : Extract metadata (tags, labels) for Docker
93
+ - name : Download digests
94
+ uses : actions/download-artifact@v4
95
+ with :
96
+ path : /tmp/digests
97
+ pattern : digests-*
98
+ merge-multiple : true
99
+
100
+ - name : Docker meta
80
101
id : meta
81
102
uses : docker/metadata-action@v5
82
103
with :
83
- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
104
+ images : ${{ env.REGISTRY_IMAGE }}
84
105
85
- - name : Create and push manifest images
86
- uses : Noelware/docker-manifest-action@master # or use a pinned version in the Releases tab
87
- with :
88
- inputs : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
89
- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64
90
- push : true
106
+ - name : Create manifest list and push
107
+ working-directory : /tmp/digests
108
+ run : |
109
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
110
+ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
111
+
112
+ - name : Inspect image
113
+ run : |
114
+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
0 commit comments