-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (85 loc) · 2.44 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build and deploy
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'LICENSE.md'
env:
NAME: jwker
FEATURE_REPOSITORY: oci://europe-north1-docker.pkg.dev/nais-io/nais/feature
GITHUB_REGISTRY: ghcr.io
jobs:
go_version:
outputs:
go_version: ${{ steps.go_version.outputs.GO_VERSION }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Find Go version
id: go_version
run: |
echo "GO_VERSION=$(grep golang .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
tests:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: go_version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ needs.go_version.outputs.go_version }}
cache-dependency-path: ./go.sum
- name: Setup Test
run: |
make kubebuilder
- name: Check for vulnerable dependencies and static code
run: make check
- name: Run tests
run: make test
build_and_push:
outputs:
version: ${{ steps.build-push-sign.outputs.version }}
needs:
- tests
permissions:
contents: "read"
id-token: "write"
name: build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/platform-build-push-sign@main
id: build-push-sign
with:
name: ${{ env.NAME }}
google_service_account: gh-${{ env.NAME }}
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
push_ghcr: true
push: true
- name: Update values.yaml
run: |
yq -i '.jwker.tag = ${{ steps.build-push-sign.outputs.version }}' charts/values.yaml
- uses: azure/setup-helm@v4
name: "Setup Helm"
with:
version: "v3.16.2"
- name: Build Chart
run: |-
yq -i '.version = ${{ steps.build-push-sign.outputs.version }}' charts/Chart.yaml
helm package charts
- name: Push Chart
run: |-
helm push tokenx-${{ env.NAME }}*.tgz ${{ env.FEATURE_REPOSITORY }}
rollout:
needs:
- build_and_push
runs-on: fasit-deploy
permissions:
id-token: write
steps:
- uses: nais/fasit-deploy@v2
with:
chart: ${{ env.FEATURE_REPOSITORY }}/tokenx-${{ env.NAME }}
version: ${{ needs.build_and_push.outputs.version }}