Skip to content

Commit

Permalink
Publish to dockerhub also
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Feb 4, 2023
1 parent 2f29e19 commit f32f37e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
pull_request:
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:

Expand All @@ -26,25 +22,34 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@11e8a2e2910826a92412015c515187a2d6750279
- uses: docker/setup-buildx-action@v2.3.0

- name: Log into registry ${{ env.REGISTRY }}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the GH Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@766400ca14a75010e7b2e3119aa0d5b46826e8c7
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@55a34859132125dc0090064b58371f30aa53395a
uses: docker/build-push-action@v3.3.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down

0 comments on commit f32f37e

Please sign in to comment.