-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.91 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
name: Bygg og deploy master
on:
push:
branches:
- 'master'
jobs:
test:
name: CICD
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm ci
working-directory: ./server
- uses: nais/docker-build-push@v0
id: dockerpush
with:
team: hot-crm
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- name: Lag sentry release
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
continue-on-error: true
run: |
export SENTRY_LOG_LEVEL=info
echo '[sentry-cli releases new]'
npx -p @sentry/cli sentry-cli releases new "${{ github.sha }}"
echo '[sentry-cli releases files]'
npx -p @sentry/cli sentry-cli releases files "${{ github.sha }}" upload-sourcemaps build/static/js \
--url-prefix '~/kursoversikt/static/js'
echo '[sentry-cli releases finalize]'
npx -p @sentry/cli sentry-cli releases finalize "${{ github.sha }}"
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/prod-gcp.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }},image=${{ steps.dockerpush.outputs.image }}