-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (63 loc) · 2.21 KB
/
deploy-dev-gcp.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
name: Deploy to dev
on:
workflow_dispatch:
inputs:
skip_tests:
description: 'Ignorer tester?'
required: false
type: boolean
env:
CI: true
TZ: Europe/Amsterdam
jobs:
pull-request-dev:
name: Build and test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
run: npm ci
env: # Kan nok fjernes igjen når vi ikke bruker ds-icons lenger
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run tests
run: npm run test
- name: Build application
run: npm run build:dev
workflow-dispatch-dev:
name: Build, test and deploy
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
run: npm ci
env: # Kan nok fjernes igjen når vi ikke bruker ds-icons lenger
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run tests
if: inputs.skip_tests == false
run: npm run test
- name: Build application
run: npm run build:dev
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCS_SA_KEY_DEV }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r build gs://obo-veilarbportefoljeflatefs-dev