Deploy to dev #1106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |