Skip to content

Commit 2651f66

Browse files
committedJul 18, 2024·
Push to Docker Hub
1 parent a5c297e commit 2651f66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎.github/workflows/docker-build.yml

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
env:
99
IMAGE_NAME: nginx
10+
DOCKERHUB_IMAGE: showfom/nginx
1011

1112
jobs:
1213
build:
@@ -24,6 +25,9 @@ jobs:
2425
- name: Log in to registry
2526
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
2627

28+
- name: Log in to Docker Hub
29+
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
30+
2731
- name: Set version tag
2832
run: echo "IMAGE_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV
2933

@@ -37,3 +41,5 @@ jobs:
3741
tags: |
3842
"ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest"
3943
"ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}"
44+
"${{ env.DOCKERHUB_IMAGE }}:latest"
45+
"${{ env.DOCKERHUB_IMAGE }}:${{ env.IMAGE_VERSION }}"

0 commit comments

Comments
 (0)
Please sign in to comment.