-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (69 loc) · 2.1 KB
/
labs.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
name: "Build and deploy aap-innsyn to labs"
on:
workflow_dispatch:
push:
branches:
- "main"
paths-ignore:
- '**.md'
env:
"IMAGE": "ghcr.io/${{ github.repository }}:${{ github.sha }}-labs"
jobs:
"build":
name: "build"
runs-on: "ubuntu-latest"
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 client 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 labs
run: cp .nais/labs.env .env.local
- name: "client tests"
run: "yarn test"
- name: "Bygg klient(yarn run build)"
run: "yarn run build"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v2"
- name: "Login to GitHub Docker Registry"
uses: "docker/login-action@v2"
with:
"registry": "ghcr.io"
"username": "${{ github.actor }}"
"password": "${{ secrets.GITHUB_TOKEN }}"
- name: "Build and push Docker"
uses: "docker/build-push-action@v4"
with:
context: .
file: Dockerfile
tags: "${{ env.IMAGE }}"
push: "true"
cache-from: "type=gha"
cache-to: "type=gha,mode=max"
"deployAppToLabs":
name: "Deploy app to labs"
needs: "build"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Deploy to LABS"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "dev-gcp"
"RESOURCE": ".nais/nais-mock.yaml"
"VARS": ".nais/labs.yaml"