Publish images to GHCR alongside DockerHub (#940)

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández 2021-10-31 15:39:56 +01:00 committed by GitHub
parent c0d05f291d
commit e874dc1f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 3 deletions

View File

@ -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
${{ secrets.DOCKERHUB_NAMESPACE }}/pihole:nightly
ghcr.io/${{ github.repository_owner }}/pihole:nightly

View File

@ -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 }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -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 }}