Skip to content

Deploy to dev

Deploy to dev #594

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@v3
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- 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@v3
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- 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@v1
with:
credentials_json: ${{ secrets.GCS_SA_KEY_DEV }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Upload files to GCS
run: gsutil -m rsync -r build gs://obo-veilarbportefoljeflatefs-dev