1- name : " Scheduled: docker"
1+ name : build/ docker
22
33on :
4- schedule :
5- - cron : ' 0 6 * * 1'
4+ workflow_call :
5+ inputs :
6+ publish :
7+ required : true
8+ type : boolean
69
710jobs :
811 lint :
912 runs-on : ubuntu-latest
1013 steps :
11- - uses : actions/checkout@v2
14+ - uses : actions/checkout@v4
1215
1316 - name : Set Swap Space
14- uses : pierotofy/set-swap-space@master
17+ uses : pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
1518 with :
1619 swap-size-gb : 12
1720
21+ - uses : actions/setup-go@v5
22+ with :
23+ go-version-file : ' go.mod'
24+ cache-dependency-path : " go.sum"
25+ check-latest : true
26+
1827 - name : Run Golangci lint
19- uses : golangci/golangci-lint-action@v2
28+ uses : golangci/golangci-lint-action@v4
2029 with :
2130 version : latest
2231 args : --print-resources-usage
2332
2433 build :
34+ name : " build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
2535 needs : lint
2636 strategy :
2737 fail-fast : false
2838 matrix :
29- Dockerfile : [Dockerfile]
30- suffix : [""]
31- latest : ["auto"]
32- include : []
39+ include :
40+ - Dockerfile : Dockerfile
41+ target : " final-static"
42+ suffix : " "
43+ latest : " auto"
44+
3345 runs-on : ubuntu-latest
3446 steps :
35- - uses : actions/checkout@v2
47+ - uses : actions/checkout@v4
3648
3749 - name : Set Swap Space
38- uses : pierotofy/set-swap-space@master
50+ uses : pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
3951 with :
4052 swap-size-gb : 12
4153
54+ - uses : actions/setup-go@v5
55+ with :
56+ go-version-file : ' go.mod'
57+ cache-dependency-path : " go.sum"
58+ check-latest : true
59+
4260 - name : Docker meta
4361 id : docker_meta
44- uses : docker/metadata-action@v4
62+ uses : docker/metadata-action@v5
4563 with :
4664 images : ${{ github.repository }},quay.io/${{ github.repository }}
4765 labels : |
@@ -51,30 +69,33 @@ jobs:
5169 suffix=${{ matrix.suffix }}
5270
5371 - name : Set up QEMU
54- uses : docker/setup-qemu-action@v1
72+ uses : docker/setup-qemu-action@v3
5573
5674 - name : Set up Docker Buildx
57- uses : docker/setup-buildx-action@v1
75+ uses : docker/setup-buildx-action@v3
5876
5977 - name : Login to DockerHub
60- uses : docker/login-action@v1
78+ uses : docker/login-action@v3
79+ if : ${{ inputs.publish }}
6180 with :
6281 username : ${{ secrets.DOCKERHUB_USERNAME }}
6382 password : ${{ secrets.DOCKERHUB_TOKEN }}
6483
6584 - name : Login to Quay
66- uses : docker/login-action@v1
85+ uses : docker/login-action@v3
86+ if : ${{ inputs.publish }}
6787 with :
6888 registry : quay.io
6989 username : ${{ secrets.QUAY_USERNAME }}
7090 password : ${{ secrets.QUAY_TOKEN }}
7191
72- - name : Build and push
73- uses : docker/build-push-action@v2
92+ - name : ${{ inputs.publish && ' Build and push' || 'Build' }}
93+ uses : docker/build-push-action@v5
7494 with :
7595 context : .
7696 file : ./${{ matrix.Dockerfile }}
97+ target : ${{ matrix.target }}
7798 platforms : linux/amd64,linux/arm64
78- push : ${{ github.event_name != 'pull_request' }}
99+ push : ${{ inputs.publish }}
79100 tags : ${{ steps.docker_meta.outputs.tags }}
80101 labels : ${{ steps.docker_meta.outputs.labels }}
0 commit comments