@@ -156,6 +156,10 @@ jobs:
156
156
if [ "${{ github.event_name }}" = "push" ]; then
157
157
TAGS="${TAGS},${IMAGE_NAME}:sha-${GITHUB_SHA::8}"
158
158
fi
159
+ for i in ${TAGS//,/ }
160
+ do
161
+ TAGS="${TAGS},ghcr.io/${i}"
162
+ done
159
163
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
160
164
echo ::set-output name=source_version::$(./bump_version.sh show)
161
165
echo ::set-output name=tags::${TAGS}
@@ -275,9 +279,10 @@ jobs:
275
279
build-push-all :
276
280
# Builds the final set of images for each of the platforms listed in
277
281
# PLATFORMS environment variable. These images are tagged with the Docker
278
- # tags calculated in the "prepare" job and pushed to DockerHub. The
279
- # contents of README.md is pushed as the image's description. This job is
280
- # skipped when the triggering event is a pull request.
282
+ # tags calculated in the "prepare" job and pushed to DockerHub and the
283
+ # GitHub Container Registry. The contents of README.md are pushed as the
284
+ # image's description to DockerHub. This job is skipped when the triggering
285
+ # event is a pull request.
281
286
name : " Build and push all platforms"
282
287
runs-on : ubuntu-latest
283
288
needs : [lint, prepare, test]
@@ -288,6 +293,12 @@ jobs:
288
293
with :
289
294
username : ${{ secrets.DOCKER_USERNAME }}
290
295
password : ${{ secrets.DOCKER_PASSWORD }}
296
+ - name : Login to GitHub Container Registry
297
+ uses : docker/login-action@v1
298
+ with :
299
+ registry : ghcr.io
300
+ username : ${{ github.actor }}
301
+ password : ${{ secrets.GITHUB_TOKEN }}
291
302
- name : Checkout
292
303
uses : actions/checkout@v2
293
304
- name : Set up QEMU
@@ -305,7 +316,7 @@ jobs:
305
316
${{ env.BASE_CACHE_KEY }}
306
317
- name : Create cross-platform support Dockerfile-x
307
318
run : ./buildx-dockerfile.sh
308
- - name : Build and push platform images to Docker Hub
319
+ - name : Build and push platform images to registries
309
320
id : docker_build
310
321
uses : docker/build-push-action@v2
311
322
with :
0 commit comments