Commit 64ba71d 1 parent 6f62f45 commit 64ba71d Copy full SHA for 64ba71d
File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Publish Docker Image
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*.*.*" # Trigger the workflow when a version tag is pushed
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ # Checkout the code
14
+ - name : Checkout code
15
+ uses : actions/checkout@v4
16
+
17
+ # Set up Docker Buildx
18
+ - name : Set up Docker Buildx
19
+ uses : docker/setup-buildx-action@v3
20
+
21
+ # Log in to Docker Hub using secrets (DOCKER_USERNAME and DOCKER_PASSWORD
22
+ - name : Log in to Docker Hub
23
+ uses : docker/login-action@v3
24
+ with :
25
+ username : ${{ secrets.DOCKER_USERNAME }}
26
+ password : ${{ secrets.DOCKER_PASSWORD }}
27
+
28
+ # Build and push the Docker image with both version and latest tags
29
+ - name : Build and push Docker image
30
+ uses : docker/build-push-action@v6
31
+ with :
32
+ context : .
33
+ push : true
34
+ platforms : linux/amd64 # Build only for amd64
35
+ tags : |
36
+ tejastn10/argus:latest
37
+ tejastn10/argus:${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments