|
37 | 37 | with: |
38 | 38 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
39 | 39 | tags: | |
40 | | - type=raw,value=amd64,enable={{is_default_branch}} |
| 40 | + type=raw,value=latest-amd64,enable={{is_default_branch}} |
41 | 41 | type=ref,event=branch,suffix=-amd64 |
42 | 42 | type=ref,event=pr,suffix=-amd64 |
43 | 43 | type=semver,pattern={{version}}-amd64 |
|
82 | 82 | with: |
83 | 83 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
84 | 84 | tags: | |
85 | | - type=raw,value=arm64,enable={{is_default_branch}} |
| 85 | + type=raw,value=latest-arm64,enable={{is_default_branch}} |
86 | 86 | type=ref,event=branch,suffix=-arm64 |
87 | 87 | type=ref,event=pr,suffix=-arm64 |
88 | 88 | type=semver,pattern={{version}}-arm64 |
@@ -131,33 +131,24 @@ jobs: |
131 | 131 |
|
132 | 132 | # For main branch or latest tag |
133 | 133 | if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then |
134 | | - # Create a manifest for latest |
135 | | - docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ |
136 | | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:amd64 \ |
137 | | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:arm64 |
138 | | - |
139 | | - # Push the manifest |
140 | | - docker manifest push --purge ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
| 134 | + # Create a manifest directly without pulling |
| 135 | + docker buildx imagetools create --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ |
| 136 | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64 \ |
| 137 | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64 |
141 | 138 | fi |
142 | 139 |
|
143 | 140 | # For tags (releases) |
144 | 141 | if [[ "${{ github.ref }}" == refs/tags/v* ]]; then |
145 | 142 | VERSION=${GITHUB_REF#refs/tags/v} |
146 | 143 | |
147 | 144 | # Create version tag manifest |
148 | | - docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION} \ |
| 145 | + docker buildx imagetools create --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION} \ |
149 | 146 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}-amd64 \ |
150 | 147 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}-arm64 |
151 | 148 | |
152 | | - # Push the manifest |
153 | | - docker manifest push --purge ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION} |
154 | | - |
155 | 149 | # Create major.minor tag manifest |
156 | 150 | MAJOR_MINOR=$(echo ${VERSION} | cut -d. -f1,2) |
157 | | - docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${MAJOR_MINOR} \ |
| 151 | + docker buildx imagetools create --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${MAJOR_MINOR} \ |
158 | 152 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}-amd64 \ |
159 | 153 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}-arm64 |
160 | | - |
161 | | - # Push the manifest |
162 | | - docker manifest push --purge ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${MAJOR_MINOR} |
163 | 154 | fi |
0 commit comments