Skip to content

Commit

Permalink
Publish images to GHCR alongside DockerHub (#940)
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <[email protected]>
  • Loading branch information
ferferga authored Oct 31, 2021
1 parent c0d05f2 commit e874dc1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
13 changes: 11 additions & 2 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
8 changes: 8 additions & 0 deletions .github/workflows/workflow_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit e874dc1

Please sign in to comment.