-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (102 loc) · 3.23 KB
/
dev.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
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
name: Build and deploy aap-soknad to dev
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**.md'
env:
IMAGE_BASE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/aap/${{ github.event.repository.name }}
jobs:
build:
name: build
runs-on: ubuntu-latest
outputs:
image: ${{ steps.image.outputs.image }}
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- name: install dependencies Yarn
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Copy env-file for dev
run: cp .nais/dev.env .env.local
- name: client tests
run: yarn test
- name: check diff on translations
run: yarn intl:diff
- name: Bygg klient(yarn run build)
run: |
npx browserslist@latest --update-db
yarn run build
- name: Upload static files to NAV CDN dev
uses: navikt/frontend/actions/cdn-upload/v1@main
with:
cdn-team-name: aap
source: ./.next/static
destination: /aap-soknad/_next
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Setter tag-navn
run: echo "TAG=$(date +%Y.%m.%d.%H%M%S)-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Setter image-navn
id: image
run: |
echo "IMAGE=$(echo $IMAGE_BASE)-$(echo $TAG)" >> $GITHUB_ENV
echo "image=$(echo $IMAGE_BASE)-$(echo $TAG)" >> $GITHUB_OUTPUT
- name: Login GAR
uses: nais/login@v0
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: aap
- name: Build and push Docker
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
tags: ${{ env.IMAGE }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
deployAppToDev:
name: Deploy app to dev
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to DEV
uses: nais/deploy/actions/deploy@v1
env:
IMAGE: ${{needs.build.outputs.image}}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yaml
VARS: .nais/dev.yaml