1414 GOOGLE_REGISTRY : " europe-north1-docker.pkg.dev"
1515
1616jobs :
17+ check :
18+ name : Static analysis
19+ runs-on : ubuntu-22.04
20+ permissions :
21+ contents : read
22+ steps :
23+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
24+ - uses : jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
25+ - run : mise run check
26+
27+ test :
28+ name : Tests
29+ runs-on : ubuntu-22.04
30+ permissions :
31+ contents : read
32+ steps :
33+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
34+ - uses : jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
35+ - run : mise run test
36+
1737 build_and_push :
1838 name : Build, push and sign images
1939 runs-on : ubuntu-22.04
40+ needs : [check, test]
2041 permissions :
2142 contents : " read"
2243 id-token : " write"
@@ -35,21 +56,41 @@ jobs:
3556 chart : true
3657 - component : canary-deployer
3758 chart : true
59+ dockerfile : Dockerfile.deploy
60+ target : canary-deployer
61+ - component : deploy-action
62+ dockerfile : Dockerfile.deploy
63+ target : deploy-action
64+ - component : deploy
65+ target : deploy
3866 steps :
39- - uses : actions/checkout@v4 # ratchet:exclude
40- - uses : azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # ratchet:azure/setup-helm@v3
67+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
68+
69+ - name : Set build metadata
70+ id : meta
71+ run : |
72+ echo "last_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
73+ echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
74+ echo "buildtime=$(date '+%s')" >> $GITHUB_OUTPUT
75+
76+ - uses : azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # ratchet:azure/setup-helm@v5
4177 if : matrix.chart
4278 with :
4379 version : " v3.11.1"
4480 - name : " Build and push image"
45- uses : nais/platform-build-push-sign@main # ratchet:exclude
81+ uses : nais/platform-build-push-sign@31014e4bcac554cb52525fe2364244c5166b84d2 # ratchet:nais/platform-build-push-sign@main
4682 id : build_push_sign
4783 with :
48- dockerfile : Dockerfile.${{ matrix.component }}
84+ dockerfile : ${{ matrix.dockerfile || format('Dockerfile.{0}', matrix.component) }}
85+ target : ${{ matrix.target }}
4986 name : ${{ matrix.component }}
5087 google_service_account : gh-deploy
5188 workload_identity_provider : ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
5289 push : ${{ github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/master' }}
90+ build_args : |
91+ LAST_COMMIT=${{ steps.meta.outputs.last_commit }}
92+ DATE=${{ steps.meta.outputs.date }}
93+ BUILDTIME=${{ steps.meta.outputs.buildtime }}
5394
5495 - name : " Package chart"
5596 if : matrix.chart
78119 - name : " Authenticate to Google Cloud"
79120 if : matrix.chart && github.ref == 'refs/heads/master'
80121 id : " auth"
81- uses : " google-github-actions/auth@v2 " # ratchet:exclude
122+ uses : " google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 " # ratchet:google-github-actions/auth@v3
82123 with :
83124 workload_identity_provider : ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
84125 service_account : " gh-deploy@nais-io.iam.gserviceaccount.com"
@@ -113,7 +154,7 @@ jobs:
113154 - build_and_push
114155 steps :
115156 - name : " Deploy hookd"
116- uses : nais/fasit-deploy@v4 # ratchet:exclude
157+ uses : nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
117158 with :
118159 chart : oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.hookd_chart_name }}
119160 version : ${{ needs.build_and_push.outputs.hookd_chart_version }}
@@ -124,7 +165,7 @@ jobs:
124165 ]
125166
126167 - name : " Deploy deployd"
127- uses : nais/fasit-deploy@v4 # ratchet:exclude
168+ uses : nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
128169 with :
129170 chart : oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.deployd_chart_name }}
130171 version : ${{ needs.build_and_push.outputs.deployd_chart_version }}
@@ -137,7 +178,7 @@ jobs:
137178 ]
138179
139180 - name : " Deploy canary-deployer"
140- uses : nais/fasit-deploy@v4 # ratchet:exclude
181+ uses : nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
141182 with :
142183 chart : oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.canary_deployer_chart_name }}
143184 version : ${{ needs.build_and_push.outputs.canary_deployer_chart_version }}
@@ -154,11 +195,9 @@ jobs:
154195 - build_and_push
155196 runs-on : ubuntu-22.04
156197 steps :
157- - uses : actions/checkout@v4 # ratchet:exclude
198+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
158199
159- - uses : actions/setup-go@v5
160- with :
161- go-version : ' stable'
200+ - uses : jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
162201
163202 - name : Force create tag
164203 env :
@@ -170,9 +209,9 @@ jobs:
170209
171210 - name : Create deploy binaries
172211 run : |
173- make deploy- release- linux
174- make deploy- release- darwin
175- make deploy- release- windows
212+ mise run release: linux
213+ mise run release: darwin
214+ mise run release: windows
176215
177216 - name : Delete release if exists
178217 env :
0 commit comments