-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (68 loc) · 2.5 KB
/
deploy-preprod-gcp.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
name: Deploy til preprod gcp
on:
workflow_dispatch:
jobs:
lint:
uses: ./.github/workflows/lint.yml
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
test:
uses: ./.github/workflows/test.yml
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
test-cypress:
uses: ./.github/workflows/cypress-tester.yml
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
build:
uses: ./.github/workflows/build.yml
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
deploy-dev-gcp:
name: Deploye til DEV GCP
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
needs: [lint, test, test-cypress, build]
steps:
- name: Hente kode
uses: actions/checkout@v4
- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Sette opp Node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://npm.pkg.github.com/
scope: '@navikt'
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Installere moduler
run: yarn workspaces focus @k9-punsj-frontend/server --production
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- uses: nais/docker-build-push@v0
id: docker-push
with:
tag: 'latest'
team: k9saksbehandling
pull: true
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- name: Set image
run: echo "IMAGE=${{steps.docker-push.outputs.image}}" >> $GITHUB_ENV
- name: Deploye til dev
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais/k9-punsj-frontend.yml
VARS: nais/dev-gcp.yml