2626 uses : ./action
2727 with :
2828 file : ./test/Dockerfile
29- -
30- name : Dump context
31- if : always()
32- uses : crazy-max/ghaction-dump-context@v1
3329
3430 git-context :
3531 runs-on : ubuntu-latest
7773 echo "::error::Digest should not be empty"
7874 exit 1
7975 fi
80- -
81- name : Dump context
82- if : always()
83- uses : crazy-max/ghaction-dump-context@v1
8476
8577 git-context-secret :
8678 runs-on : ubuntu-latest
@@ -137,10 +129,6 @@ jobs:
137129 echo "::error::Digest should not be empty"
138130 exit 1
139131 fi
140- -
141- name : Dump context
142- if : always()
143- uses : crazy-max/ghaction-dump-context@v1
144132
145133 path-context :
146134 runs-on : ubuntu-latest
@@ -192,10 +180,6 @@ jobs:
192180 echo "::error::Digest should not be empty"
193181 exit 1
194182 fi
195- -
196- name : Dump context
197- if : always()
198- uses : crazy-max/ghaction-dump-context@v1
199183
200184 error :
201185 runs-on : ubuntu-latest
@@ -223,10 +207,6 @@ jobs:
223207 echo "::error::Should have failed"
224208 exit 1
225209 fi
226- -
227- name : Dump context
228- if : always()
229- uses : crazy-max/ghaction-dump-context@v1
230210
231211 error-buildx :
232212 runs-on : ubuntu-latest
@@ -259,10 +239,6 @@ jobs:
259239 echo "::error::Should have failed"
260240 exit 1
261241 fi
262- -
263- name : Dump context
264- if : always()
265- uses : crazy-max/ghaction-dump-context@v1
266242
267243 docker-driver :
268244 runs-on : ubuntu-latest
@@ -284,10 +260,6 @@ jobs:
284260 file : ./test/Dockerfile
285261 push : true
286262 tags : localhost:5000/name/app:latest
287- -
288- name : Dump context
289- if : always()
290- uses : crazy-max/ghaction-dump-context@v1
291263
292264 export-docker :
293265 runs-on : ubuntu-latest
@@ -307,10 +279,6 @@ jobs:
307279 name : Inspect
308280 run : |
309281 docker image inspect myimage:latest
310- -
311- name : Dump context
312- if : always()
313- uses : crazy-max/ghaction-dump-context@v1
314282
315283 network :
316284 runs-on : ubuntu-latest
@@ -331,10 +299,6 @@ jobs:
331299 context : ./test
332300 tags : name/app:latest
333301 network : host
334- -
335- name : Dump context
336- if : always()
337- uses : crazy-max/ghaction-dump-context@v1
338302
339303 shm-size :
340304 runs-on : ubuntu-latest
@@ -357,10 +321,6 @@ jobs:
357321 file : ./test/shmsize.Dockerfile
358322 tags : name/app:latest
359323 shm-size : 2g
360- -
361- name : Dump context
362- if : always()
363- uses : crazy-max/ghaction-dump-context@v1
364324
365325 ulimit :
366326 runs-on : ubuntu-latest
@@ -385,10 +345,6 @@ jobs:
385345 ulimit : |
386346 nofile=1024:1024
387347 nproc=3
388- -
389- name : Dump context
390- if : always()
391- uses : crazy-max/ghaction-dump-context@v1
392348
393349 cgroup-parent :
394350 runs-on : ubuntu-latest
@@ -411,10 +367,6 @@ jobs:
411367 file : ./test/cgroup.Dockerfile
412368 tags : name/app:latest
413369 cgroup-parent : foo
414- -
415- name : Dump context
416- if : always()
417- uses : crazy-max/ghaction-dump-context@v1
418370
419371 add-hosts :
420372 runs-on : ubuntu-latest
@@ -435,10 +387,6 @@ jobs:
435387 add-hosts : |
436388 docker:10.180.0.1
437389 foo:10.0.0.1
438- -
439- name : Dump context
440- if : always()
441- uses : crazy-max/ghaction-dump-context@v1
442390
443391 multi :
444392 runs-on : ubuntu-latest
@@ -494,10 +442,94 @@ jobs:
494442 echo "::error::Digest should not be empty"
495443 exit 1
496444 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
497527 -
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 }}
501533
502534 registry-cache :
503535 runs-on : ubuntu-latest
@@ -584,10 +616,6 @@ jobs:
584616 echo "::error::Digests should be identical"
585617 exit 1
586618 fi
587- -
588- name : Dump context
589- if : always()
590- uses : crazy-max/ghaction-dump-context@v1
591619
592620 local-cache-first :
593621 runs-on : ubuntu-latest
@@ -650,10 +678,6 @@ jobs:
650678 echo "::error::Digest should not be empty"
651679 exit 1
652680 fi
653- -
654- name : Dump context
655- if : always()
656- uses : crazy-max/ghaction-dump-context@v1
657681
658682 local-cache-hit :
659683 runs-on : ubuntu-latest
@@ -723,10 +747,6 @@ jobs:
723747 -
724748 name : Cache hit
725749 run : echo ${{ steps.cache.outputs.cache-hit }}
726- -
727- name : Dump context
728- if : always()
729- uses : crazy-max/ghaction-dump-context@v1
730750
731751 github-cache :
732752 runs-on : ubuntu-latest
@@ -773,7 +793,3 @@ jobs:
773793 name : Inspect
774794 run : |
775795 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