From e874dc1f3e69347787dc20a9a3dcd6005899791f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Sun, 31 Oct 2021 15:39:56 +0100 Subject: [PATCH] Publish images to GHCR alongside DockerHub (#940) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fernando Fernández --- .github/workflows/nightly-build.yml | 10 +++++++++- .github/workflows/test-and-build.yaml | 13 +++++++++++-- .github/workflows/workflow_dispatch.yml | 8 ++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 01672f4af..4692dbbc1 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -46,6 +46,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -59,4 +66,5 @@ jobs: PIHOLE_VERSION=nightly push: true tags: | - ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole:nightly \ No newline at end of file + ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole:nightly + ghcr.io/${{ github.repository_owner }}/pihole:nightly diff --git a/.github/workflows/test-and-build.yaml b/.github/workflows/test-and-build.yaml index 43208e744..015372729 100644 --- a/.github/workflows/test-and-build.yaml +++ b/.github/workflows/test-and-build.yaml @@ -38,7 +38,9 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole + images: | + ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole + ghcr.io/${{ github.repository_owner }}/pihole github-token: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU @@ -52,6 +54,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -62,4 +71,4 @@ jobs: PIHOLE_VERSION=${{ env.TAG }} push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/workflow_dispatch.yml b/.github/workflows/workflow_dispatch.yml index 89a0cd55f..d8c16155f 100644 --- a/.github/workflows/workflow_dispatch.yml +++ b/.github/workflows/workflow_dispatch.yml @@ -51,6 +51,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -65,3 +72,4 @@ jobs: push: true tags: | ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole:${{ github.event.inputs.name }} + ghcr.io/${{ github.repository_owner }}/pihole:${{ github.event.inputs.name }}