-
Notifications
You must be signed in to change notification settings - Fork 3
121 lines (113 loc) · 3.42 KB
/
bygg-og-deploy-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
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
name: Bygg og deploy master
on:
push:
branches:
- 'master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
IMAGE: ghcr.io/${{ github.repository }}/tiltaksgjennomforing:${{ github.sha }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
jobs:
bygg:
permissions:
packages: write
name: Bygg
runs-on: ubuntu-20.04
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Server yarn install
working-directory: ./server
run: yarn install --frozen-lockfile
- name: Server yarn build
working-directory: ./server
run: yarn build
- name: Installer avhengigheter
run: yarn install --frozen-lockfile
- name: Kjør tester
run: yarn test
- name: Bygg
run: yarn run build
- name: Sett opp sentry release
run: yarn run release
- name: Bygg, tag og push Docker-image
run: |
echo ${GITHUB_TOKEN} | docker login ghcr.io -u ${GITHUB_REPOSITORY} --password-stdin
docker build --tag ${IMAGE} .
docker push ${IMAGE}
deploy-prod-gcp-intern:
name: Deploy til prod-gcp intern
runs-on: ubuntu-20.04
needs: bygg
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Deploy til prod-gcp intern
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-intern.yaml
PRINT_PAYLOAD: true
VARS: nais/prod-gcp-intern.yaml
deploy-prod-gcp-ekstern:
name: Deploy til prod-gcp ekstern
runs-on: ubuntu-20.04
needs: bygg
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Deploy til prod-gcp ekstern
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
PRINT_PAYLOAD: true
VARS: nais/prod-gcp-ekstern.yaml
deploy-dev-gcp-intern:
name: Deploy til dev-gcp intern
runs-on: ubuntu-20.04
needs: bygg
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Deploy til dev-gcp intern
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-intern.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-intern.yaml
deploy-dev-gcp-ekstern:
name: Deploy til dev-gcp ekstern
runs-on: ubuntu-20.04
needs: bygg
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Deploy til dev-gcp ekstern
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-ekstern.yaml
deploy-dev-gcp-labs:
name: Deploy til dev-gcp (labs)
runs-on: ubuntu-20.04
needs: bygg
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/dev-gcp-labs.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-labs.json