14
14
- ' docker-bake.hcl'
15
15
- ' .github/workflows/CI.yml'
16
16
workflow_dispatch :
17
- inputs :
18
- tag :
19
- description : ' which tag need to publish'
20
- default : ' '
21
- required : false
22
17
23
18
jobs :
24
19
build :
20
+ strategy :
21
+ matrix :
22
+ target : [ "all", "18", "17", "16", "16-alpine", "15", "14", "13", "12", "11", "10", "9", "8", "7"]
25
23
runs-on : ubuntu-latest
26
24
steps :
27
25
- uses : actions/checkout@v4
@@ -42,18 +40,14 @@ jobs:
42
40
- name : Check buildx bake
43
41
run : docker buildx bake --file docker-bake.hcl --print
44
42
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
48
46
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
52
50
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