@@ -31,31 +31,20 @@ jobs:
31
31
steps :
32
32
- name : Checkout Repository
33
33
uses : actions/checkout@v2
34
- - name : Fetch Cached Artifacts
34
+ - name : Setup Golang Environment
35
+ uses : actions/setup-go@v2
36
+ with :
37
+ go-version : ' ${{ env.GOLANG_VERSION }}'
38
+ - name : Build Binary
39
+ run : >
40
+ make build
41
+ env :
42
+ GOFLAGS : ' -mod=vendor -gcflags=-trimpath=${{ github.workspace }} -asmflags=-trimpath=${{ github.workspace }}'
43
+ - name : Store Artifacts in Cache
35
44
uses : actions/cache@v2.1.4
36
45
with :
37
46
path : ${{ github.workspace }}/nginx-asg-sync
38
47
key : nginx-asg-sync-${{ github.run_id }}-${{ github.run_number }}
39
- - name : Docker Buildx
40
- uses : docker/setup-buildx-action@v1
41
- with :
42
- driver-opts : network=host
43
- - name : Cache Docker layers
44
- uses : actions/cache@v2.1.4
45
- with :
46
- path : /tmp/.buildx-cache
47
- key : ${{ runner.os }}-buildx-${{ github.sha }}
48
- restore-keys : |
49
- ${{ runner.os }}-buildx-
50
- - name : Build Image
51
- uses : docker/build-push-action@v2
52
- with :
53
- file : build/Dockerfile
54
- context : ' .'
55
- target : builder
56
- cache-from : type=local,src=/tmp/.buildx-cache
57
- cache-to : type=local,dest=/tmp/.buildx-cache
58
- tags : nginx/nginx-asg-sync:${{ github.sha }}
59
48
60
49
unit-tests :
61
50
name : Unit Tests
@@ -98,13 +87,14 @@ jobs:
98
87
with :
99
88
file : build/Dockerfile
100
89
context : ' .'
101
- target : rpm_based
90
+ target : local
102
91
load : true
103
92
cache-from : type=local,src=/tmp/.buildx-cache
104
93
cache-to : type=local,dest=/tmp/.buildx-cache
105
94
tags : amazon-builder:${{ github.sha }}
106
95
build-args : |
107
96
CONTAINER_VERSION=amazonlinux:1
97
+ OS_TYPE=rpm_based
108
98
- name : Run Amazon 1
109
99
uses : addnab/docker-run-action@v2
110
100
with :
@@ -116,13 +106,14 @@ jobs:
116
106
with :
117
107
file : build/Dockerfile
118
108
context : ' .'
119
- target : rpm_based
109
+ target : local
120
110
load : true
121
111
cache-from : type=local,src=/tmp/.buildx-cache
122
112
cache-to : type=local,dest=/tmp/.buildx-cache
123
113
tags : amazon2-builder:${{ github.sha }}
124
114
build-args : |
125
115
CONTAINER_VERSION=amazonlinux:2
116
+ OS_TYPE=rpm_based
126
117
- name : Run Amazon 2
127
118
uses : addnab/docker-run-action@v2
128
119
with :
@@ -134,32 +125,52 @@ jobs:
134
125
with :
135
126
file : build/Dockerfile
136
127
context : ' .'
137
- target : rpm_based
128
+ target : local
138
129
load : true
139
130
cache-from : type=local,src=/tmp/.buildx-cache
140
131
cache-to : type=local,dest=/tmp/.buildx-cache
141
132
tags : centos7-builder:${{ github.sha }}
142
133
build-args : |
143
134
CONTAINER_VERSION=centos:7
135
+ OS_TYPE=rpm_based
144
136
- name : Run Centos 7
145
137
uses : addnab/docker-run-action@v2
146
138
with :
147
139
image : centos7-builder:${{ github.sha }}
148
140
run : /build.sh
149
141
options : -v ${{ github.workspace }}/build/package/rpm:/rpm -v ${{ github.workspace }}/build_output:/build_output
142
+ - name : Build Image Centos 8
143
+ uses : docker/build-push-action@v2
144
+ with :
145
+ file : build/Dockerfile
146
+ context : ' .'
147
+ target : local
148
+ load : true
149
+ cache-from : type=local,src=/tmp/.buildx-cache
150
+ cache-to : type=local,dest=/tmp/.buildx-cache
151
+ tags : centos7-builder:${{ github.sha }}
152
+ build-args : |
153
+ CONTAINER_VERSION=centos:8
154
+ OS_TYPE=rpm_based
155
+ - name : Run Centos 8
156
+ uses : addnab/docker-run-action@v2
157
+ with :
158
+ image : centos8-builder:${{ github.sha }}
159
+ run : /build.sh
160
+ options : -v ${{ github.workspace }}/build/package/rpm:/rpm -v ${{ github.workspace }}/build_output:/build_output
150
161
- name : Build Image Ubuntu Xenial
151
162
uses : docker/build-push-action@v2
152
163
with :
153
164
file : build/Dockerfile
154
165
context : ' .'
155
- target : deb_based
166
+ target : local
156
167
load : true
157
168
cache-from : type=local,src=/tmp/.buildx-cache
158
169
cache-to : type=local,dest=/tmp/.buildx-cache
159
170
tags : ubuntu-xenial-builder:${{ github.sha }}
160
171
build-args : |
161
172
CONTAINER_VERSION=ubuntu:xenial
162
- OS_VERSION=xenial
173
+ OS_TYPE=deb_based
163
174
- name : Run Ubuntu Xenial
164
175
uses : addnab/docker-run-action@v2
165
176
with :
@@ -171,14 +182,14 @@ jobs:
171
182
with :
172
183
file : build/Dockerfile
173
184
context : ' .'
174
- target : deb_based
185
+ target : local
175
186
load : true
176
187
cache-from : type=local,src=/tmp/.buildx-cache
177
188
cache-to : type=local,dest=/tmp/.buildx-cache
178
189
tags : ubuntu-bionic-builder:${{ github.sha }}
179
190
build-args : |
180
191
CONTAINER_VERSION=ubuntu:bionic
181
- OS_VERSION=bionic
192
+ OS_TYPE=deb_based
182
193
- name : Run Ubuntu Bionic
183
194
uses : addnab/docker-run-action@v2
184
195
with :
@@ -190,14 +201,14 @@ jobs:
190
201
with :
191
202
file : build/Dockerfile
192
203
context : ' .'
193
- target : deb_based
204
+ target : local
194
205
load : true
195
206
cache-from : type=local,src=/tmp/.buildx-cache
196
207
cache-to : type=local,dest=/tmp/.buildx-cache
197
208
tags : ubuntu-focal-builder:${{ github.sha }}
198
209
build-args : |
199
210
CONTAINER_VERSION=ubuntu:focal
200
- OS_VERSION=focal
211
+ OS_TYPE=deb_based
201
212
- name : Run Ubuntu Focal
202
213
uses : addnab/docker-run-action@v2
203
214
with :
@@ -209,14 +220,14 @@ jobs:
209
220
with :
210
221
file : build/Dockerfile
211
222
context : ' .'
212
- target : deb_based
223
+ target : local
213
224
load : true
214
225
cache-from : type=local,src=/tmp/.buildx-cache
215
226
cache-to : type=local,dest=/tmp/.buildx-cache
216
227
tags : ubuntu-groovy-builder:${{ github.sha }}
217
228
build-args : |
218
229
CONTAINER_VERSION=ubuntu:groovy
219
- OS_VERSION=groovy
230
+ OS_TYPE=deb_based
220
231
- name : Run Ubuntu Groovy
221
232
uses : addnab/docker-run-action@v2
222
233
with :
0 commit comments