3030 id : meta
3131 uses : docker/metadata-action@v5
3232 with :
33- images : |
34- ${{ env.REGISTRY_IMAGE }}
35- ghcr.io/${{ env.REGISTRY_IMAGE }}
33+ images : ${{ env.REGISTRY_IMAGE }}
3634 tags : |
3735 type=ref,event=branch
3836 type=ref,event=pr
5351 username : ${{ secrets.DOCKERHUB_USERNAME }}
5452 password : ${{ secrets.DOCKERHUB_TOKEN }}
5553
56- - name : Login to GitHub Container Registry
57- uses : docker/login-action@v3
58- with :
59- registry : ghcr.io
60- username : ${{ github.actor }}
61- password : ${{ secrets.GITHUB_TOKEN }}
62-
6354 - name : Build and push by digest
6455 id : build
6556 uses : docker/build-push-action@v5
10495 id : meta
10596 uses : docker/metadata-action@v5
10697 with :
107- images : |
108- ${{ env.REGISTRY_IMAGE }}
109- ghcr.io/${{ env.REGISTRY_IMAGE }}
98+ images : ${{ env.REGISTRY_IMAGE }}
11099 tags : |
111100 type=ref,event=branch
112101 type=ref,event=pr
@@ -121,33 +110,16 @@ jobs:
121110 username : ${{ secrets.DOCKERHUB_USERNAME }}
122111 password : ${{ secrets.DOCKERHUB_TOKEN }}
123112
124- - name : Login to GitHub Container Registry
125- uses : docker/login-action@v3
126- with :
127- registry : ghcr.io
128- username : ${{ github.actor }}
129- password : ${{ secrets.GITHUB_TOKEN }}
130-
131113 - name : Create manifest list and push
132114 working-directory : /tmp/digests
133115 run : |
134116 docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
135117 $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
136118
137- - name : Create manifest list and push (GHCR)
138- working-directory : /tmp/digests
139- run : |
140- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON" | sed 's|${{ env.REGISTRY_IMAGE }}|ghcr.io/${{ env.REGISTRY_IMAGE }}|g') \
141- $(printf 'ghcr.io/${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
142-
143- - name : Inspect image (Docker Hub)
119+ - name : Inspect image
144120 run : |
145121 docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
146122
147- - name : Inspect image (GHCR)
148- run : |
149- docker buildx imagetools inspect ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
150-
151123 - name : Update Docker Hub Description
152124 uses : peter-evans/dockerhub-description@v4
153125 if : github.event_name != 'pull_request'
0 commit comments