26
26
uses : ./action
27
27
with :
28
28
file : ./test/Dockerfile
29
- -
30
- name : Dump context
31
- if : always()
32
- uses : crazy-max/ghaction-dump-context@v1
33
29
34
30
git-context :
35
31
runs-on : ubuntu-latest
77
73
echo "::error::Digest should not be empty"
78
74
exit 1
79
75
fi
80
- -
81
- name : Dump context
82
- if : always()
83
- uses : crazy-max/ghaction-dump-context@v1
84
76
85
77
git-context-secret :
86
78
runs-on : ubuntu-latest
@@ -137,10 +129,6 @@ jobs:
137
129
echo "::error::Digest should not be empty"
138
130
exit 1
139
131
fi
140
- -
141
- name : Dump context
142
- if : always()
143
- uses : crazy-max/ghaction-dump-context@v1
144
132
145
133
path-context :
146
134
runs-on : ubuntu-latest
@@ -192,10 +180,6 @@ jobs:
192
180
echo "::error::Digest should not be empty"
193
181
exit 1
194
182
fi
195
- -
196
- name : Dump context
197
- if : always()
198
- uses : crazy-max/ghaction-dump-context@v1
199
183
200
184
error :
201
185
runs-on : ubuntu-latest
@@ -223,10 +207,6 @@ jobs:
223
207
echo "::error::Should have failed"
224
208
exit 1
225
209
fi
226
- -
227
- name : Dump context
228
- if : always()
229
- uses : crazy-max/ghaction-dump-context@v1
230
210
231
211
error-buildx :
232
212
runs-on : ubuntu-latest
@@ -259,10 +239,6 @@ jobs:
259
239
echo "::error::Should have failed"
260
240
exit 1
261
241
fi
262
- -
263
- name : Dump context
264
- if : always()
265
- uses : crazy-max/ghaction-dump-context@v1
266
242
267
243
docker-driver :
268
244
runs-on : ubuntu-latest
@@ -284,10 +260,6 @@ jobs:
284
260
file : ./test/Dockerfile
285
261
push : true
286
262
tags : localhost:5000/name/app:latest
287
- -
288
- name : Dump context
289
- if : always()
290
- uses : crazy-max/ghaction-dump-context@v1
291
263
292
264
export-docker :
293
265
runs-on : ubuntu-latest
@@ -307,10 +279,6 @@ jobs:
307
279
name : Inspect
308
280
run : |
309
281
docker image inspect myimage:latest
310
- -
311
- name : Dump context
312
- if : always()
313
- uses : crazy-max/ghaction-dump-context@v1
314
282
315
283
network :
316
284
runs-on : ubuntu-latest
@@ -331,10 +299,6 @@ jobs:
331
299
context : ./test
332
300
tags : name/app:latest
333
301
network : host
334
- -
335
- name : Dump context
336
- if : always()
337
- uses : crazy-max/ghaction-dump-context@v1
338
302
339
303
shm-size :
340
304
runs-on : ubuntu-latest
@@ -357,10 +321,6 @@ jobs:
357
321
file : ./test/shmsize.Dockerfile
358
322
tags : name/app:latest
359
323
shm-size : 2g
360
- -
361
- name : Dump context
362
- if : always()
363
- uses : crazy-max/ghaction-dump-context@v1
364
324
365
325
ulimit :
366
326
runs-on : ubuntu-latest
@@ -385,10 +345,6 @@ jobs:
385
345
ulimit : |
386
346
nofile=1024:1024
387
347
nproc=3
388
- -
389
- name : Dump context
390
- if : always()
391
- uses : crazy-max/ghaction-dump-context@v1
392
348
393
349
cgroup-parent :
394
350
runs-on : ubuntu-latest
@@ -411,10 +367,6 @@ jobs:
411
367
file : ./test/cgroup.Dockerfile
412
368
tags : name/app:latest
413
369
cgroup-parent : foo
414
- -
415
- name : Dump context
416
- if : always()
417
- uses : crazy-max/ghaction-dump-context@v1
418
370
419
371
add-hosts :
420
372
runs-on : ubuntu-latest
@@ -435,10 +387,6 @@ jobs:
435
387
add-hosts : |
436
388
docker:10.180.0.1
437
389
foo:10.0.0.1
438
- -
439
- name : Dump context
440
- if : always()
441
- uses : crazy-max/ghaction-dump-context@v1
442
390
443
391
multi :
444
392
runs-on : ubuntu-latest
@@ -494,10 +442,94 @@ jobs:
494
442
echo "::error::Digest should not be empty"
495
443
exit 1
496
444
fi
445
+
446
+ digest :
447
+ runs-on : ubuntu-latest
448
+ env :
449
+ DOCKER_IMAGE : localhost:5000/name/app
450
+ strategy :
451
+ fail-fast : false
452
+ matrix :
453
+ driver :
454
+ - docker
455
+ - docker-container
456
+ load :
457
+ - true
458
+ - false
459
+ push :
460
+ - true
461
+ - false
462
+ exclude :
463
+ - driver : docker
464
+ load : true
465
+ push : true
466
+ - driver : docker-container
467
+ load : true
468
+ push : true
469
+ - driver : docker
470
+ load : false
471
+ push : false
472
+ - driver : docker-container
473
+ load : false
474
+ push : false
475
+ services :
476
+ registry :
477
+ image : registry:2
478
+ ports :
479
+ - 5000:5000
480
+ steps :
481
+ -
482
+ name : Checkout
483
+ uses : actions/checkout@v2
484
+ -
485
+ name : Set up Docker Buildx
486
+ uses : docker/setup-buildx-action@v1
487
+ with :
488
+ version : v0.8.0
489
+ driver : ${{ matrix.driver }}
490
+ driver-opts : |
491
+ network=host
492
+ -
493
+ name : Build
494
+ id : docker_build
495
+ uses : ./
496
+ with :
497
+ context : ./test
498
+ load : ${{ matrix.load }}
499
+ push : ${{ matrix.push }}
500
+ tags : ${{ env.DOCKER_IMAGE }}:latest
501
+ platforms : ${{ matrix.platforms }}
502
+ -
503
+ name : Docker images
504
+ run : |
505
+ docker image ls --no-trunc
506
+ -
507
+ name : Check digest
508
+ if : ${{ matrix.push }}
509
+ run : |
510
+ if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
511
+ echo "::error::Digest should not be empty"
512
+ exit 1
513
+ fi
514
+ -
515
+ name : Check manifest
516
+ if : ${{ matrix.push }}
517
+ run : |
518
+ set -x
519
+ docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}@${{ steps.docker_build.outputs.digest }} --format '{{json .}}'
520
+ -
521
+ name : Check image ID
522
+ run : |
523
+ if [ -z "${{ steps.docker_build.outputs.imageid }}" ]; then
524
+ echo "::error::Image ID should not be empty"
525
+ exit 1
526
+ fi
497
527
-
498
- name : Dump context
499
- if : always()
500
- uses : crazy-max/ghaction-dump-context@v1
528
+ name : Inspect image
529
+ if : ${{ matrix.load }}
530
+ run : |
531
+ set -x
532
+ docker image inspect ${{ steps.docker_build.outputs.imageid }}
501
533
502
534
registry-cache :
503
535
runs-on : ubuntu-latest
@@ -584,10 +616,6 @@ jobs:
584
616
echo "::error::Digests should be identical"
585
617
exit 1
586
618
fi
587
- -
588
- name : Dump context
589
- if : always()
590
- uses : crazy-max/ghaction-dump-context@v1
591
619
592
620
local-cache-first :
593
621
runs-on : ubuntu-latest
@@ -650,10 +678,6 @@ jobs:
650
678
echo "::error::Digest should not be empty"
651
679
exit 1
652
680
fi
653
- -
654
- name : Dump context
655
- if : always()
656
- uses : crazy-max/ghaction-dump-context@v1
657
681
658
682
local-cache-hit :
659
683
runs-on : ubuntu-latest
@@ -723,10 +747,6 @@ jobs:
723
747
-
724
748
name : Cache hit
725
749
run : echo ${{ steps.cache.outputs.cache-hit }}
726
- -
727
- name : Dump context
728
- if : always()
729
- uses : crazy-max/ghaction-dump-context@v1
730
750
731
751
github-cache :
732
752
runs-on : ubuntu-latest
@@ -773,7 +793,3 @@ jobs:
773
793
name : Inspect
774
794
run : |
775
795
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
776
- -
777
- name : Dump context
778
- if : always()
779
- uses : crazy-max/ghaction-dump-context@v1
0 commit comments