3
3
schedule :
4
4
- cron : ' 23 2 * * *'
5
5
push :
6
- branches :
7
- - main
8
6
pull_request :
9
- branches :
10
- - main
11
7
12
8
13
9
@@ -52,23 +48,13 @@ jobs:
52
48
# Login against a Docker registry except on PR
53
49
# https://github.com/docker/login-action
54
50
- name : Log into registry ${{ env.REGISTRY }}
55
- if : github.event_name != 'pull_request'
51
+ if : github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
56
52
uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
57
53
with :
58
54
registry : ${{ env.REGISTRY }}
59
55
username : ${{ secrets.REGISTRY_USER }}
60
56
password : ${{ secrets.REGISTRY_PW }}
61
57
62
- - name : Build image
63
- id : build
64
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
65
- with :
66
- context : .
67
- pull : true
68
- load : true
69
- tags : docker-nfs-server:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
70
- cache-to : type=gha,mode=max
71
- cache-from : type=gha,mode=max
72
58
73
59
- name : Finding latest release
74
60
id : version
@@ -83,16 +69,21 @@ jobs:
83
69
with :
84
70
input_string : " ${{ steps.version.outputs.release }}"
85
71
86
-
87
- - name : Publish image
88
- id : push
89
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
72
+ - name : Build image
73
+ id : build
74
+ uses : docker/build-push-action@v2
90
75
with :
91
76
context : .
92
- push : true
93
- pull : true
94
- cache-to : type=gha,mode=max
95
- cache-from : type=gha,mode=max
77
+ platforms : |
78
+ linux/amd64
79
+ linux/arm64
80
+ linux/i386
81
+ linux/armhf
82
+ linux/armel
83
+
84
+ # pull: true
85
+ # load: true
86
+ push : ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
96
87
tags : |
97
88
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.semver_parser.outputs.major }}
98
89
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}
0 commit comments