Skip to content

Commit 3c5e96b

Browse files
authored
Merge pull request #1976 from kalsi-avneet/topic/push-to-dockerhub
Docker publish workflow: Login and push to dockerhub as well
2 parents df96778 + f864984 commit 3c5e96b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/docker-publish.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
REGISTRY: ghcr.io
11+
GHCR_REGISTRY: ghcr.io
1212
IMAGE_NAME: ${{ github.repository }}
1313

1414
jobs:
@@ -22,18 +22,26 @@ jobs:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
2424

25-
- name: Log in to the Container registry
25+
- name: Log in to the ghcr container registry
2626
uses: docker/login-action@v3
2727
with:
28-
registry: ${{ env.REGISTRY }}
28+
registry: ${{ env.GHCR_REGISTRY }}
2929
username: ${{ github.actor }}
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

32+
- name: Log in to the dockerhub container registry
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ vars.DOCKERHUB_ORGNAME }}
36+
password: ${{ secrets.DOCKERHUB_TOKEN }}
37+
3238
- name: Extract metadata for Docker build
3339
id: meta
3440
uses: docker/metadata-action@v5
3541
with:
36-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
images: |
43+
name=${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
44+
name=${{ env.IMAGE_NAME }}
3745
flavor: latest=true
3846
tags: |
3947
type=semver,pattern={{version}}

0 commit comments

Comments
 (0)