Skip to content

Commit 5b39f5a

Browse files
committed
Workflow - push to Docker Hub
1 parent e52c427 commit 5b39f5a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/docker-image.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,20 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ vars.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PAT }}
21+
1622
- name: Build the Docker image
1723
run: |
24+
TIMESTAMP=$(date +%s)
1825
docker build . --file Dockerfile \
19-
--tag ghcr.io/${{ github.repository }}:$(date +%s) \
20-
--tag ghcr.io/${{ github.repository }}:latest
26+
--tag ${{ vars.DOCKER_USERNAME }}/kv:${TIMESTAMP} \
27+
--tag ${{ vars.DOCKER_USERNAME }}/kv:latest
28+
29+
- name: Push Docker image
30+
run: |
31+
docker push ${{ vars.DOCKER_USERNAME }}/kv:$(date +%s)
32+
docker push ${{ vars.DOCKER_USERNAME }}/kv:latest

0 commit comments

Comments
 (0)