File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed
Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - ' *'
7+ branches :
8+ - master
79
810jobs :
911 docker :
1012 runs-on : ubuntu-latest
1113 steps :
12- -
13- name : Checkout
14+ - name : Checkout
1415 uses : actions/checkout@v3
15- -
16- name : Set up QEMU
16+
17+ - name : Set up QEMU
1718 uses : docker/setup-qemu-action@v2
18- -
19- name : Set up Docker Buildx
19+
20+ - name : Set up Docker Buildx
2021 uses : docker/setup-buildx-action@v2
21- -
22- name : Login to DockerHub
22+
23+ - name : Login to DockerHub
2324 uses : docker/login-action@v2
2425 with :
2526 username : mesudip
2627 password : ${{ secrets.DOCKERHUB_TOKEN }}
2728
28- -
29- name : Build and push
29+ - name : Build and push for tags
30+ if : startsWith(github.ref, 'refs/tags/')
3031 uses : docker/build-push-action@v3
3132 with :
3233 file : Dockerfile
3334 context : .
34- platforms : linux/amd64, linux/arm64
35+ platforms : linux/amd64,linux/arm64
3536 push : true
3637 tags : |
3738 mesudip/nginx-proxy:${{ github.ref_name }}
3839 mesudip/nginx-proxy:latest
40+
41+ - name : Build and push for main branch
42+ if : github.ref == 'refs/heads/main'
43+ uses : docker/build-push-action@v3
44+ with :
45+ file : Dockerfile
46+ context : .
47+ platforms : linux/amd64,linux/arm64
48+ push : true
49+ tags : mesudip/nginx-proxy:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments