File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 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+ with :
25+ context : .
26+ push : true
27+ tags : ${{ secrets.DOCKER_USERNAME }}/gh-demo:latest
You can’t perform that action at this time.
0 commit comments