-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (64 loc) · 2.14 KB
/
build-dev-mock-historisk.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
name: "Labs: historisk snapshot"
on:
workflow_dispatch:
push:
branches:
- "labs-historisk-**"
env:
"IMAGE": "ghcr.io/${{ github.repository }}-labs-historisk:${{ github.sha }}"
jobs:
buildMock:
name: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
SKIP_YARN_COREPACK_CHECK: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Enable Corepack
run: corepack enable
- name: Cache client node_modules
id: cache-node-modules
uses: actions/cache@v4
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 --immutable
- name: Copy env-file # TODO: Se om vi kan finne en bedre løsning her på sikt
run: cp .nais/dev-mock.env .env
- name: run build
run: yarn run build
- uses: nais/docker-build-push@v0
with:
team: aap
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
image_suffix: -dev-gcp-mock-historisk
tag: ${{ github.sha }}
"deployAppToLabsHistorisk":
name: "Deploy branch to dev"
needs: "buildMock"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: gacts/github-slug@v1
id: slug
with:
to-slug: aap-soknad-${{ github.ref_name }}
- name: "Deploy historisk søknad til dev"
uses: "nais/deploy/actions/deploy@v2"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "dev-gcp"
"RESOURCE": ".nais/historisk-dev-mock.yaml"
"VAR": image=${{ env.IMAGE }},ingress=https://${{ steps.slug.outputs.slug }}.ekstern.dev.nav.no,appname=${{ steps.slug.outputs.slug }},replicas=1,branchState=alive