chore: Migrate client to vite! (#844) #157
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: API Build and Deploy Production | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "api/**" | |
- ".github/workflows/api-prod.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_PROD_CONFIG }} | |
APP_YAML: ${{ secrets.API_PROD_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.prod.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 |