4
4
paths-ignore:
5
5
- "*.md"
6
6
env :
7
- image : ghcr.io/${{ github.repository }}
7
+ GOOGLE_REGISTRY : europe-north1-docker.pkg.dev
8
+
8
9
jobs :
9
10
build:
10
11
name: Build Docker container
@@ -16,57 +17,25 @@ jobs:
16
17
outputs:
17
18
version: ${{ steps.gen-version.outputs.version }}
18
19
steps:
19
- - uses : actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # ratchet:actions/checkout@v3
20
- - name : Generate version tags
21
- id : gen-version
22
- run : |
23
- echo "version=$(./version.sh)" >> ${GITHUB_OUTPUT}
24
- - name : Install cosign
25
- uses : sigstore/cosign-installer@00bf1366a3f8c043c1f6f802441642bced142f5c # ratchet:sigstore/cosign-installer@main
26
- with :
27
- cosign-release : ' v2.2.1'
28
- - name : Verify runner image
29
- run :
cosign verify --certificate-oidc-issuer https://accounts.google.com --certificate-identity [email protected] gcr.io/distroless/static-debian11:nonroot
30
- - name : Set up Docker Buildx
31
- id : buildx
32
- uses : docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # ratchet:docker/setup-buildx-action@v2
33
- - name : Login to registry
34
- if : github.ref == 'refs/heads/master'
35
- uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # ratchet:docker/login-action@v2
36
- with :
37
- registry : ghcr.io
38
- username : ${{ github.actor }}
39
- password : ${{ secrets.GITHUB_TOKEN }}
40
- - name : Build and push
41
- uses : docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # ratchet:docker/build-push-action@v4
42
- id : build-push
20
+ - uses: actions/checkout@v4
21
+ - name: Build push and sign
22
+ uses: nais/platform-build-push-sign@main # ratchet:exclude
23
+ id: build-push-sign
43
24
with:
44
- context : .
45
- file : Dockerfile
46
- push : ${{ github.ref == 'refs/heads/master' }}
47
- tags : ${{ env.image }}:${{ steps.gen-version.outputs.version }}
48
- cache-from : type=gha
49
- cache-to : type=gha,mode=max
50
- - name : Sign the container image
51
- run : cosign sign --yes ${{ env.image }}@${{ steps.build-push.outputs.digest }}
52
- - name : Create SBOM
53
- uses : aquasecurity/trivy-action@1f0aa582c8c8f5f7639610d6d38baddfea4fdcee # ratchet:aquasecurity/trivy-action@master
54
- with :
55
- scan-type : ' image'
56
- format : ' cyclonedx'
57
- output : ' cyclone.sbom.json'
58
- image-ref : ${{ env.image }}@${{ steps.build-push.outputs.digest }}
59
- - name : Attest image
60
- run : cosign attest --yes --predicate 'cyclone.sbom.json' --type cyclonedx ${{ env.image }}@${{ steps.build-push.outputs.digest }}
25
+ name: deployment-event-relays
26
+ google_service_account: gh-deployment-event-relays
27
+ workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
28
+ push: true
61
29
62
30
rollout:
31
+ name: Rollout
32
+ if: github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/master'
33
+ needs: build
34
+ runs-on: fasit-deploy
63
35
permissions:
64
36
id-token: write
65
- needs : ["build"]
66
- runs-on : fasit-deploy
67
- if : github.ref == 'refs/heads/master'
68
37
steps:
69
- - uses : nais/fasit-deploy@b2c0b6d049b53bef41b321eec406fe66938576fd # ratchet:nais/fasit-deploy@main
38
+ - uses: nais/fasit-deploy@v2 # ratchet:exclude
70
39
with:
71
- json : ' {"image": {"tag": " ${{ needs.build.outputs.version }}"}} '
72
- feature_name : deployd
40
+ chart: oci:// ${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/deployd
41
+ # version: ${{ needs.build.outputs.chart_version }}
0 commit comments