Skip to content

chore: Re-add fix npm vulnerabilities on api (rebuilds api/package-lo… #306

chore: Re-add fix npm vulnerabilities on api (rebuilds api/package-lo…

chore: Re-add fix npm vulnerabilities on api (rebuilds api/package-lo… #306

Workflow file for this run

name: API Build and Deploy Staging
on:
push:
branches: [dev]
paths:
- "api/**"
- ".github/workflows/api-staging.yaml"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
concurrency:
group: api-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
CONFIG_JSON: ${{ secrets.API_STAGING_CONFIG }}
APP_YAML: ${{ secrets.API_STAGING_GCP_APP_YAML }}
DISPATCH_YAML: ${{ secrets.COMMON_GCP_DISPATCH_YAML }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.16
uses: actions/setup-node@v2
with:
node-version: "16.16"
- name: npm 8.18
run: npm install -g [email protected]
- name: API and GCP Config
uses: actions/github-script@v4
with:
script: |
const fs = require('fs')
fs.writeFileSync('./api/src/data/config.staging.json', process.env.CONFIG_JSON)
fs.writeFileSync('./api/dispatch.yaml', process.env.DISPATCH_YAML)
fs.writeFileSync('./api/app.yaml', process.env.APP_YAML)
- uses: google-github-actions/setup-gcloud@v0
with:
version: latest
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Deploy
run: |
cd api
gcloud app deploy app.yaml dispatch.yaml --quiet