This repository was archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (65 loc) · 2.33 KB
/
deploy.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
name: Bygg og deploy
on: [push]
env:
IMAGE: ghcr.io/${{ github.repository }}/rekrutteringsbistand-container:${{ github.sha }}
jobs:
bygg-og-push-docker-image:
name: Bygg og push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: |
package-lock.json
server/package-lock.json
- name: Installer avhengigheter
run: npm ci
- name: Bygg applikasjon
run: npm run build
- name: Test applikasjon
run: npm run test
- name: Installer avhengigheter for server
run: cd server && npm ci
- name: Bygg server
run: cd server && npm run build
- name: Test server
run: cd server && npm run test
- name: Logg inn til Github
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Bygg og publiser Docker-image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.IMAGE }}
deploy-til-dev:
name: Deploy til dev-gcp
needs: bygg-og-push-docker-image
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stillingssok-match-wildcard'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: deploy/nais-dev.yaml
deploy-to-prod:
name: Deploy til prod-gcp
needs: deploy-til-dev
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: deploy/nais-prod.yaml