1414 - ' docker-bake.hcl'
1515 - ' .github/workflows/CI.yml'
1616 workflow_dispatch :
17- inputs :
18- tag :
19- description : ' which tag need to publish'
20- default : ' '
21- required : false
2217
2318jobs :
2419 build :
20+ strategy :
21+ matrix :
22+ target : [ "all", "18", "17", "16", "16-alpine", "15", "14", "13", "12", "11", "10", "9", "8", "7"]
2523 runs-on : ubuntu-latest
2624 steps :
2725 - uses : actions/checkout@v4
@@ -42,18 +40,14 @@ jobs:
4240 - name : Check buildx bake
4341 run : docker buildx bake --file docker-bake.hcl --print
4442
45- - name : Build all images
46- if : github.ref == 'refs/heads/master' && github.event.inputs.tag == ''
47- run : docker buildx bake --file docker-bake.hcl --load
43+ - name : Publish an image for tag ${{ matrix.target }}
44+ if : github.ref == 'refs/heads/master'
45+ run : docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --load
4846
49- - name : Publish an image for tag ${{ inputs.tag }}
50- if : github.ref == 'refs/heads/master' && github.event.inputs.tag != ' '
51- run : docker buildx bake --file docker-bake.hcl ${{ inputs.tag }} --load
47+ - name : Publish an image for tag ${{ matrix.target }}
48+ if : github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch '
49+ run : docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --push
5250
53- - name : Publish all images
54- if : github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && github.event.inputs.tag == ''
55- run : docker buildx bake --file docker-bake.hcl --push
56-
57- - name : Publish an image for tag ${{ inputs.tag }}
58- if : github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
59- run : docker buildx bake --file docker-bake.hcl ${{ inputs.tag }} --push
51+ - name : Remove builder instances
52+ if : github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
53+ run : docker buildx rm --all-inactive --force
0 commit comments