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 4
4
push :
5
5
tags :
6
6
- ' *'
7
+ branches :
8
+ - master
7
9
8
10
jobs :
9
11
docker :
10
12
runs-on : ubuntu-latest
11
13
steps :
12
- -
13
- name : Checkout
14
+ - name : Checkout
14
15
uses : actions/checkout@v3
15
- -
16
- name : Set up QEMU
16
+
17
+ - name : Set up QEMU
17
18
uses : docker/setup-qemu-action@v2
18
- -
19
- name : Set up Docker Buildx
19
+
20
+ - name : Set up Docker Buildx
20
21
uses : docker/setup-buildx-action@v2
21
- -
22
- name : Login to DockerHub
22
+
23
+ - name : Login to DockerHub
23
24
uses : docker/login-action@v2
24
25
with :
25
26
username : mesudip
26
27
password : ${{ secrets.DOCKERHUB_TOKEN }}
27
28
28
- -
29
- name : Build and push
29
+ - name : Build and push for tags
30
+ if : startsWith(github.ref, 'refs/tags/')
30
31
uses : docker/build-push-action@v3
31
32
with :
32
33
file : Dockerfile
33
34
context : .
34
- platforms : linux/amd64, linux/arm64
35
+ platforms : linux/amd64,linux/arm64
35
36
push : true
36
37
tags : |
37
38
mesudip/nginx-proxy:${{ github.ref_name }}
38
39
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