Skip to content

Commit 741f2ea

Browse files
committed
Push to docker hub
1 parent cca6a73 commit 741f2ea

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/deploy.yml

+31-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
push-store-image:
10+
push-to-ghcr:
11+
name: Push Docker image to GHCR
1112
runs-on: ubuntu-latest
1213

1314
steps:
@@ -25,4 +26,32 @@ jobs:
2526
run: docker build . --tag ghcr.io/hemantapkh/torrenthunt:latest
2627

2728
- name: 'Push to GHCR'
28-
run: docker push ghcr.io/hemantapkh/torrenthunt:latest
29+
run: docker push ghcr.io/hemantapkh/torrenthunt:latest
30+
31+
push-to-docker-hub:
32+
name: Push Docker image to Docker Hub
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Check out the repo
36+
uses: actions/checkout@v4
37+
38+
- name: Log in to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ secrets.DOCKER_USERNAME }}
42+
password: ${{ secrets.DOCKER_PASSWORD }}
43+
44+
- name: Extract metadata (tags, labels) for Docker
45+
id: meta
46+
uses: docker/metadata-action@v5
47+
with:
48+
images: hemantapkh/torrenthunt
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
52+
with:
53+
context: .
54+
file: ./Dockerfile
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)