-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (72 loc) · 2.21 KB
/
build_n_deploy_prod.yaml
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
name: Build&deploy to dev and prod
on:
push:
branches:
- 'main'
env:
VERSION: familie-tilbake-frontend:${{ github.sha }}
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: yarn
registry-url: "https://npm.pkg.github.com"
- name: Yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
run: yarn --prefer-offline --frozen-lockfile
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ github.sha }}
run: |
yarn build
yarn test
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: teamfamilie
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # Provided as Organization Secret
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # Provided as Organization Variable
deployDev:
name: Deploy to gcp-dev
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-gcp team namespace
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: build_n_deploy/naiserator/naiserator_dev_gcp.yaml
VAR: image=${{ needs.build.outputs.image }},VERSION=${{ env.VERSION }}
deployProd:
name: Deploy to gcp-prod
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Deploy til prod-gcp team namespace
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: build_n_deploy/naiserator/naiserator_prod_gcp.yaml
VAR: image=${{ needs.build.outputs.image }},VERSION=${{ env.VERSION }}