From 281ddea64e9629506b4f4a6ecdcf2cb78690a5c2 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Fri, 9 Feb 2024 15:21:52 -0800 Subject: [PATCH] Add push to ghcr.io in parallel --- .github/workflows/publish.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d8f32c02..71165435 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -8,7 +8,8 @@ on: workflow_dispatch: env: - REGISTRY: docker.io + REGISTRY: ghcr.io + REGISTRY_OLD: docker.io BASE_IMAGE_REPO: python BASE_IMAGE_TAG: '3.8.7-buster' @@ -146,7 +147,9 @@ jobs: id: docker_meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ github.repository }} + images: | + ${{ env.REGISTRY_OLD }}/${{ github.repository }} + ${{ env.REGISTRY }}/${{ github.repository }} flavor: | latest=auto suffix=${{ matrix.tag-suffix }},onlatest=true @@ -168,12 +171,16 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ${{ env.REGISTRY_OLD }} username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} -# for ghcr.io, use: -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: build_push