44 push :
55 branches :
66 - main
7+ paths :
8+ - Dockerfile
9+ - .github/workflows/docker.yml
10+ - cron_entrypoint.sh
11+ # only build without pushing on PRs
712 pull_request :
13+ paths :
14+ - Dockerfile
15+ - .github/workflows/docker.yml
16+ - cron_entrypoint.sh
817 workflow_dispatch :
918 schedule :
1019 - cron : " 0 0 * * *"
1120
1221permissions :
1322 contents : read
1423
24+ # only allow one build at a time per branch
25+ concurrency :
26+ group : ci-${{ github.ref }}
27+ cancel-in-progress : true
28+
1529env :
1630 DO_PUSH : ${{ github.ref == 'refs/heads/main' }} # do not push on PRs
1731
2034 timeout-minutes : 80
2135 runs-on : ubuntu-latest
2236
37+ strategy :
38+ matrix :
39+ versions :
40+ - rt : " 5.0.8"
41+ rtir : " 5.0.8"
42+ - rt : " 6.0.0"
43+ rtir : " 5.0.8"
44+ - rt : " 6.0.1"
45+ rtir : " 6.0.1"
46+ latest : " true"
47+
2348 steps :
2449 - name : checkout sources
2550 uses : actions/checkout@v5
@@ -33,26 +58,22 @@ jobs:
3358 with :
3459 install : true
3560
36- - name : Docker rt5 meta
37- id : metart5
38- uses : docker/metadata-action@v5
39- with :
40- images : firefart/requesttracker
41- tags : |
42- type=raw,value=5
43- type=raw,value=5.0.8
44- type=schedule,pattern={{date 'YYYYMMDD'}},prefix=nightly-5-
45-
46- - name : Docker rt6 meta
47- id : metart6
61+ - name : Docker meta
62+ id : meta
4863 uses : docker/metadata-action@v5
4964 with :
5065 images : firefart/requesttracker
66+ flavor : |
67+ # disable setting the latest tag by default
68+ latest=false
5169 tags : |
52- type=raw,value=latest
53- type=raw,value=6
54- type=raw,value=6.0.0
55- type=schedule,pattern={{date 'YYYYMMDD'}},prefix=nightly-
70+ # Enable latest tag if set
71+ type=raw,value=latest,enable=${{ matrix.versions.latest == 'true' }}
72+ # Create a tag for the major version
73+ type=semver,pattern={{major}},value=${{ matrix.versions.rt }}
74+ # Create a tag for the full version
75+ type=raw,value=${{ matrix.versions.rt }}
76+ type=schedule,pattern={{date 'YYYYMMDD'}},prefix=nightly-${{ matrix.versions.major }}-
5677
5778 - name : Login to Docker Hub
5879 uses : docker/login-action@v3.5.0
@@ -61,22 +82,16 @@ jobs:
6182 username : ${{ secrets.DOCKERHUB_USERNAME }}
6283 password : ${{ secrets.DOCKERHUB_TOKEN }}
6384
64- - name : Build and push RT5
85+ - name : Build and push
6586 uses : docker/build-push-action@v6
6687 with :
6788 build-args : |
68- RT_VERSION=5.0.8
69- context : .
70- file : Dockerfile
71- push : ${{ env.DO_PUSH }}
72- tags : ${{ steps.metart5.outputs.tags }}
73- labels : ${{ steps.metart5.outputs.labels }}
74-
75- - name : Build and push RT6
76- uses : docker/build-push-action@v6
77- with :
89+ RT_VERSION=${{ matrix.versions.rt }}
90+ RTIR_VERSION=${{ matrix.versions.rtir }}
7891 context : .
7992 file : Dockerfile
93+ sbom : true
94+ provenance : mode=max
8095 push : ${{ env.DO_PUSH }}
81- tags : ${{ steps.metart6 .outputs.tags }}
82- labels : ${{ steps.metart6 .outputs.labels }}
96+ tags : ${{ steps.meta .outputs.tags }}
97+ labels : ${{ steps.meta .outputs.labels }}
0 commit comments