1- name : " Release: docker"
1+ name : build/ docker
22
33on :
4- push :
5- branches :
6- - ' ** '
7- tags :
8- - ' *.*.* '
4+ workflow_call :
5+ inputs :
6+ publish :
7+ required : true
8+ type : boolean
99
1010jobs :
1111 lint :
1212 runs-on : ubuntu-latest
1313 steps :
14- - uses : actions/checkout@v2
14+ - uses : actions/checkout@v4
1515
1616 - name : Set Swap Space
17- uses : pierotofy/set-swap-space@master
17+ uses : pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
1818 with :
1919 swap-size-gb : 12
2020
2121 - name : Run Golangci lint
22- uses : golangci/golangci-lint-action@v2
22+ uses : golangci/golangci-lint-action@v3
2323 with :
2424 version : latest
2525 args : --print-resources-usage
2626
2727 build :
28+ name : " build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
2829 needs : lint
2930 strategy :
3031 fail-fast : false
3132 matrix :
32- Dockerfile : [Dockerfile.ubuntu]
33- suffix : ["-ubuntu"]
34- latest : ["auto"]
3533 include :
36- - Dockerfile : Dockerfile.alpine
37- suffix : -alpine
34+ -
35+ Dockerfile : Dockerfile
36+ target : " final-ubuntu"
37+ suffix : " -ubuntu"
38+ latest : " auto"
39+ -
40+ Dockerfile : Dockerfile
41+ target : " final-alpine"
42+ suffix : " -alpine"
3843 latest : false
39- - Dockerfile : Dockerfile.debian
40- suffix : -debian
44+ -
45+ Dockerfile : Dockerfile
46+ target : " final-debian"
47+ suffix : " -debian"
4148 latest : false
49+
4250 runs-on : ubuntu-latest
4351 steps :
44- - uses : actions/checkout@v2
52+ - uses : actions/checkout@v4
4553
4654 - name : Set Swap Space
47- uses : pierotofy/set-swap-space@master
55+ uses : pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
4856 with :
4957 swap-size-gb : 12
5058
5159 - name : Docker meta
5260 id : docker_meta
53- uses : docker/metadata-action@v4
61+ uses : docker/metadata-action@v5
5462 with :
5563 images : ${{ github.repository }},quay.io/${{ github.repository }}
5664 labels : |
@@ -60,30 +68,33 @@ jobs:
6068 suffix=${{ matrix.suffix }}
6169
6270 - name : Set up QEMU
63- uses : docker/setup-qemu-action@v1
71+ uses : docker/setup-qemu-action@v3
6472
6573 - name : Set up Docker Buildx
66- uses : docker/setup-buildx-action@v1
74+ uses : docker/setup-buildx-action@v3
6775
6876 - name : Login to DockerHub
69- uses : docker/login-action@v1
77+ uses : docker/login-action@v3
78+ if : ${{ inputs.publish }}
7079 with :
7180 username : ${{ secrets.DOCKERHUB_USERNAME }}
7281 password : ${{ secrets.DOCKERHUB_TOKEN }}
7382
7483 - name : Login to Quay
75- uses : docker/login-action@v1
84+ uses : docker/login-action@v3
85+ if : ${{ inputs.publish }}
7686 with :
7787 registry : quay.io
7888 username : ${{ secrets.QUAY_USERNAME }}
7989 password : ${{ secrets.QUAY_TOKEN }}
8090
81- - name : Build and push
82- uses : docker/build-push-action@v2
91+ - name : ${{ inputs.publish && ' Build and push' || 'Build' }}
92+ uses : docker/build-push-action@v5
8393 with :
8494 context : .
8595 file : ./${{ matrix.Dockerfile }}
86- platforms : linux/amd64,linux/arm64,linux/arm
87- push : ${{ github.event_name != 'pull_request' }}
96+ target : ${{ matrix.target }}
97+ platforms : linux/amd64,linux/arm64
98+ push : ${{ inputs.publish }}
8899 tags : ${{ steps.docker_meta.outputs.tags }}
89100 labels : ${{ steps.docker_meta.outputs.labels }}
0 commit comments