@@ -45,19 +45,18 @@ jobs:
45
45
runs-on : ubuntu-20.04
46
46
steps :
47
47
- name : Checkout Repository
48
- uses : actions/checkout@v2
48
+ uses : actions/checkout@v3
49
49
with :
50
50
fetch-depth : 0
51
51
- name : Output Variables
52
52
id : commit
53
53
run : |
54
54
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
55
- - name : Determine Go version from go.mod
56
- run : echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
57
55
- name : Setup Golang Environment
58
- uses : actions/setup-go@v2
56
+ uses : actions/setup-go@v3
59
57
with :
60
- go-version : ${{ env.GO_VERSION }}
58
+ go-version-file : go.mod
59
+ cache : true
61
60
- name : Determine GOPATH
62
61
run : echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
63
62
- name : Check if CRDs changed
70
69
uses : goreleaser/goreleaser-action@v2
71
70
with :
72
71
version : latest
73
- args : --rm-dist --debug --skip-publish --snapshot
72
+ args : build --snapshot --rm-dist --single-target
74
73
env :
75
74
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76
75
GOPATH : ${{ env.GOPATH }}
@@ -85,13 +84,12 @@ jobs:
85
84
runs-on : ubuntu-20.04
86
85
steps :
87
86
- name : Checkout Repository
88
- uses : actions/checkout@v2
89
- - name : Determine Go version from go.mod
90
- run : echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
87
+ uses : actions/checkout@v3
91
88
- name : Setup Golang Environment
92
- uses : actions/setup-go@v2
89
+ uses : actions/setup-go@v3
93
90
with :
94
- go-version : ${{ env.GO_VERSION }}
91
+ go-version-file : go.mod
92
+ cache : true
95
93
- name : Run Tests
96
94
run : go test ./...
97
95
@@ -105,7 +103,7 @@ jobs:
105
103
image : [debian, alpine, opentracing, ubi]
106
104
steps :
107
105
- name : Checkout Repository
108
- uses : actions/checkout@v2
106
+ uses : actions/checkout@v3
109
107
- name : Output Variables
110
108
id : commit
111
109
run : |
@@ -116,41 +114,36 @@ jobs:
116
114
path : ${{ github.workspace }}/dist
117
115
key : nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
118
116
- name : Docker Buildx
119
- uses : docker/setup-buildx-action@v1
120
- - name : Cache Docker layers for ${{ matrix.image }}
121
- uses : actions/cache@v2
122
- with :
123
- path : /tmp/.buildx-${{ matrix.image }}-cache
124
- key : ${{ runner.os }}-buildx-${{ matrix.image }}-${{ github.sha }}
125
- restore-keys : |
126
- ${{ runner.os }}-buildx-${{ matrix.image }}-
117
+ uses : docker/setup-buildx-action@v2
127
118
- name : Build ${{ matrix.image }} Container
128
- uses : docker/build-push-action@v2
119
+ uses : docker/build-push-action@v3
129
120
with :
130
121
file : build/Dockerfile
131
122
context : ' .'
132
- cache-from : type=local,src=/tmp/.buildx- ${{ matrix.image }}-cache
133
- cache-to : type=local,dest=/tmp/.buildx- ${{ matrix.image }}-cache
123
+ cache-from : type=gha,scope= ${{ matrix.image }}
124
+ cache-to : type=gha,scope= ${{ matrix.image }},mode=max
134
125
target : goreleaser
135
126
tags : ${{ matrix.image }}:${{ github.sha }}
136
127
load : true
137
128
build-args : |
138
129
BUILD_OS=${{ matrix.image }}
139
130
NGINX_VERSION=${{ steps.commit.outputs.nginx_version }}
140
131
- name : Run Trivy vulnerability scanner
141
- uses : aquasecurity/trivy-action@master
132
+ uses :
aquasecurity/[email protected]
133
+ continue-on-error : true
142
134
with :
143
135
image-ref : ' ${{ matrix.image }}:${{ github.sha }}'
144
- format : ' template'
145
- template : ' @/contrib/sarif.tpl'
136
+ format : ' sarif'
146
137
output : ' trivy-results-${{ matrix.image }}.sarif'
147
138
ignore-unfixed : ' true'
148
139
- name : Upload Trivy scan results to GitHub Security tab
149
- uses : github/codeql-action/upload-sarif@v1
140
+ uses : github/codeql-action/upload-sarif@v2
141
+ continue-on-error : true
150
142
with :
151
143
sarif_file : ' trivy-results-${{ matrix.image }}.sarif'
152
144
- name : Upload Scan Results
153
- uses : actions/upload-artifact@v2
145
+ uses : actions/upload-artifact@v3
146
+ continue-on-error : true
154
147
with :
155
148
name : ' trivy-results-${{ matrix.image }}.sarif'
156
149
path : ' trivy-results-${{ matrix.image }}.sarif'
@@ -176,7 +169,7 @@ jobs:
176
169
marker : ' policies'
177
170
steps :
178
171
- name : Checkout Repository
179
- uses : actions/checkout@v2
172
+ uses : actions/checkout@v3
180
173
- name : Output Variables
181
174
id : commit
182
175
run : |
@@ -187,34 +180,27 @@ jobs:
187
180
path : ${{ github.workspace }}/dist
188
181
key : nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
189
182
- name : Docker Buildx
190
- uses : docker/setup-buildx-action@v1
191
- - name : Cache Docker layers for ${{ matrix.image }}
192
- uses : actions/cache@v2
193
- with :
194
- path : /tmp/.buildx-${{ matrix.image }}-cache
195
- key : ${{ runner.os }}-buildx-${{ matrix.image }}-${{ github.sha }}
196
- restore-keys : |
197
- ${{ runner.os }}-buildx-${{ matrix.image }}-
183
+ uses : docker/setup-buildx-action@v2
198
184
- name : Build ${{ matrix.image }} Container
199
- uses : docker/build-push-action@v2
185
+ uses : docker/build-push-action@v3
200
186
with :
201
187
file : build/Dockerfile
202
188
context : ' .'
203
- cache-from : type=local,src=/tmp/.buildx- ${{ matrix.image }}-cache
204
- cache-to : type=local,dest=/tmp/.buildx- ${{ matrix.image }}-cache
189
+ cache-from : type=gha,scope= ${{ matrix.image }}
190
+ cache-to : type=gha,scope= ${{ matrix.image }},mode=max
205
191
target : goreleaser
206
192
tags : ${{ matrix.image }}:${{ github.sha }}
207
193
load : true
208
194
build-args : |
209
195
BUILD_OS=${{ matrix.image }}
210
196
NGINX_VERSION=${{ steps.commit.outputs.nginx_version }}
211
197
- name : Build Test-Runner Container
212
- uses : docker/build-push-action@v2
198
+ uses : docker/build-push-action@v3
213
199
with :
214
200
file : tests/docker/Dockerfile
215
201
context : ' .'
216
- cache-from : type=local,src=/tmp/.buildx-cache
217
- cache-to : type=local,dest=/tmp/.buildx-cache
202
+ cache-from : type=gha,scope=test-runner
203
+ cache-to : type=gha,scope=test-runner,mode=max
218
204
tags : test-runner:${{ github.sha }}
219
205
load : true
220
206
- name : Deploy Kubernetes
@@ -246,7 +232,7 @@ jobs:
246
232
-m ${{ matrix.marker }}
247
233
working-directory : ./tests
248
234
- name : Upload Test Results
249
- uses : actions/upload-artifact@v2
235
+ uses : actions/upload-artifact@v3
250
236
with :
251
237
name : test-results-${{ steps.k8s.outputs.cluster }}
252
238
path : ${{ github.workspace }}/tests/tests-${{ steps.k8s.outputs.cluster }}.html
@@ -263,30 +249,23 @@ jobs:
263
249
HELM_HTTP_POSTFIX : s
264
250
steps :
265
251
- name : Checkout Repository
266
- uses : actions/checkout@v2
252
+ uses : actions/checkout@v3
267
253
- name : Fetch Cached Artifacts
268
254
uses : actions/cache@v2
269
255
with :
270
256
path : ${{ github.workspace }}/dist
271
257
key : nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
272
258
- name : Docker Buildx
273
- uses : docker/setup-buildx-action@v1
259
+ uses : docker/setup-buildx-action@v2
274
260
with :
275
261
driver-opts : network=host
276
- - name : Docker build cache
277
- uses : actions/cache@v2
278
- with :
279
- path : /tmp/.buildx-cache
280
- key : ${{ runner.os }}-buildx-${{ github.sha }}
281
- restore-keys : |
282
- ${{ runner.os }}-buildx-
283
262
- name : Build Docker Image nginx-ingress
284
- uses : docker/build-push-action@v2
263
+ uses : docker/build-push-action@v3
285
264
with :
286
265
file : build/Dockerfile
287
266
context : ' .'
288
- cache-from : type=local,src=/tmp/.buildx-cache
289
- cache-to : type=local,dest=/tmp/.buildx-cache
267
+ cache-from : type=gha,scope=debian
268
+ cache-to : type=gha,scope=debian,mode=max
290
269
target : goreleaser
291
270
tags : nginx-ingress:${{ github.sha }}
292
271
load : true
@@ -339,7 +318,7 @@ jobs:
339
318
platforms : linux/arm64,linux/amd64
340
319
steps :
341
320
- name : Checkout Repository
342
- uses : actions/checkout@v2
321
+ uses : actions/checkout@v3
343
322
with :
344
323
fetch-depth : 0
345
324
- name : Output Variables
@@ -355,30 +334,23 @@ jobs:
355
334
path : ${{ github.workspace }}/dist
356
335
key : nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
357
336
- name : Setup QEMU
358
- uses : docker/setup-qemu-action@v1
337
+ uses : docker/setup-qemu-action@v2
359
338
with :
360
339
platforms : arm,arm64,ppc64le,s390x
361
340
- name : Docker Buildx
362
- uses : docker/setup-buildx-action@v1
363
- - name : Cache Docker layers for ${{ matrix.image }}
364
- uses : actions/cache@v2
365
- with :
366
- path : /tmp/.buildx-${{ matrix.image }}-cache
367
- key : ${{ runner.os }}-buildx-${{ matrix.image }}-${{ github.sha }}
368
- restore-keys : |
369
- ${{ runner.os }}-buildx-${{ matrix.image }}-
341
+ uses : docker/setup-buildx-action@v2
370
342
- name : DockerHub Login
371
- uses : docker/login-action@v1
343
+ uses : docker/login-action@v2
372
344
with :
373
345
username : ${{ secrets.DOCKER_USERNAME }}
374
346
password : ${{ secrets.DOCKER_PASSWORD }}
375
347
- name : Push to Dockerhub
376
- uses : docker/build-push-action@v2
348
+ uses : docker/build-push-action@v3
377
349
with :
378
350
file : build/Dockerfile
379
351
context : ' .'
380
- cache-from : type=local,src=/tmp/.buildx- ${{ matrix.image }}-cache
381
- cache-to : type=local,dest=/tmp/.buildx- ${{ matrix.image }}-cache
352
+ cache-from : type=gha,scope= ${{ matrix.type }}
353
+ cache-to : type=gha,scope= ${{ matrix.type }},mode=max
382
354
target : goreleaser
383
355
tags : nginx/nginx-ingress:${{ matrix.tag }}
384
356
platforms : ${{ matrix.platforms }}
@@ -397,15 +369,15 @@ jobs:
397
369
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
398
370
steps :
399
371
- name : Checkout Repository
400
- uses : actions/checkout@v2
372
+ uses : actions/checkout@v3
401
373
- name : Lint
402
374
run : |
403
375
helm lint ${{ env.HELM_CHART_DIR }} || true
404
376
- name : Package
405
377
run : |
406
378
helm package --version ${{ env.HELM_CHART_VERSION }} ${{ env.HELM_CHART_DIR }}
407
379
- name : Upload Chart
408
- uses : actions/upload-artifact@v2
380
+ uses : actions/upload-artifact@v3
409
381
with :
410
382
name : helm-chart
411
383
path : ${{ github.workspace }}/nginx-ingress-${{ env.HELM_CHART_VERSION }}.tgz
@@ -417,7 +389,7 @@ jobs:
417
389
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
418
390
steps :
419
391
- name : Checkout Repository
420
- uses : actions/checkout@v2
392
+ uses : actions/checkout@v3
421
393
with :
422
394
repository : nginxinc/helm-charts
423
395
fetch-depth : 1
0 commit comments