We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aabadbc commit 5de028dCopy full SHA for 5de028d
1 file changed
.github/workflows/publish-docker-image.yaml
@@ -0,0 +1,27 @@
1
+name: Build and Push Docker Image
2
+on:
3
+ workflow_dispatch: # Allow manual runs too
4
+
5
+jobs:
6
+ build-and-push:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ # Step 1: Checkout the repo
10
+ - name: Checkout code
11
+ uses: actions/checkout@v4
12
+ # Step 2: Log in to Docker Hub
13
+ - name: Log in to Docker Hub
14
+ uses: docker/login-action@v3
15
+ with:
16
+ username: ${{ secrets.DOCKER_USERNAME }}
17
+ password: ${{ secrets.DOCKER_PASSWORD }}
18
+ # Step 3: Set up Docker Buildx
19
+ - name: Set up Docker Buildx
20
+ uses: docker/setup-buildx-action@v3
21
+ # Step 4: Build and push the image
22
+ - name: Build and push Docker image
23
+ uses: docker/build-push-action@v5
24
25
+ context: .
26
+ push: true
27
+ tags: ${{ secrets.DOCKER_USERNAME }}/gh-demo:latest
0 commit comments