-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (141 loc) · 4.14 KB
/
bygg-og-deploy.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Bygg og deploy
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
build:
name: Bygg
permissions:
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
runs-on: ubuntu-latest
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'
- name: Install
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Server install
working-directory: ./server
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Typescript
run: npm run ts
- name: Prettier
run: npm run prettier
- name: Kjør tester
run: npm run test
- name: Build
run: npm run build
- name: Server build
working-directory: ./server
run: npm run build
- name: Sentry release
run: npm run release
- name: Fjerne source maps
run: |
rm dist/client/assets/*.map
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: arbeidsgiver
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
deploy-dev-gcp-intern:
name: Deploy til dev-gcp intern
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til dev-gcp intern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-intern.yaml
VARS: nais/dev-gcp-intern.yaml
VAR: image=${{ needs.build.outputs.image }}
deploy-dev-gcp-ekstern:
name: Deploy til dev-gcp ekstern
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til dev-gcp ekstern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
VARS: nais/dev-gcp-ekstern.yaml
VAR: image=${{ needs.build.outputs.image }}
deploy-dev-gcp-labs:
name: Deploy til dev-gcp (labs)
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais/dev-gcp-labs.yaml
VARS: nais/dev-gcp-labs.json
VAR: image=${{ needs.build.outputs.image }}
deploy-prod-gcp-intern:
name: Deploy til prod-gcp intern
if: github.ref == 'refs/heads/master'
needs: [build, deploy-dev-gcp-intern, deploy-dev-gcp-ekstern, deploy-dev-gcp-labs]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til prod-gcp intern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-intern.yaml
VARS: nais/prod-gcp-intern.yaml
VAR: image=${{ needs.build.outputs.image }}
deploy-prod-gcp-ekstern:
name: Deploy til prod-gcp ekstern
if: github.ref == 'refs/heads/master'
needs: [build, deploy-dev-gcp-intern, deploy-dev-gcp-ekstern, deploy-dev-gcp-labs]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til prod-gcp ekstern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
VARS: nais/prod-gcp-ekstern.yaml
VAR: image=${{ needs.build.outputs.image }}