Setup actions to deploy frontend and run checks
This commit is contained in:
parent
b6f64fa23b
commit
1628c1502e
23
.github/workflows/check_api.yml
vendored
Normal file
23
.github/workflows/check_api.yml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
name: API Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- api/**
|
||||
- .github/workflows/check_api.yml
|
||||
|
||||
# Fail on warnings
|
||||
env:
|
||||
RUSTFLAGS: "-Dwarnings"
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: api
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: cargo clippy
|
||||
42
.github/workflows/check_frontend.yml
vendored
Normal file
42
.github/workflows/check_frontend.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
name: Frontend Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- frontend/**
|
||||
- .github/workflows/check_frontend.yml
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: frontend
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: '**/yarn.lock'
|
||||
- run: yarn install --immutable
|
||||
- run: yarn lint --max-warnings 0
|
||||
|
||||
typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: frontend
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: '**/yarn.lock'
|
||||
- run: yarn install --immutable
|
||||
- run: yarn tsc
|
||||
37
.github/workflows/deploy_frontend.yml
vendored
37
.github/workflows/deploy_frontend.yml
vendored
|
|
@ -2,36 +2,37 @@ name: Deploy Frontend
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: ['main']
|
||||
paths: ['frontend/**']
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- frontend/**
|
||||
- .github/workflows/deploy_frontend.yml
|
||||
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Vercel
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: frontend
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 17
|
||||
node-version: 18
|
||||
cache: yarn
|
||||
cache-dependency-path: '**/yarn.lock'
|
||||
- run: yarn install --immutable
|
||||
- run: yarn build
|
||||
- id: auth
|
||||
uses: google-github-actions/auth@v0
|
||||
with:
|
||||
credentials_json: '${{ secrets.GCP_SA_KEY }}'
|
||||
- id: deploy
|
||||
uses: google-github-actions/deploy-appengine@v0
|
||||
with:
|
||||
working_directory: frontend
|
||||
version: v1
|
||||
- name: Install Vercel CLI
|
||||
run: yarn global install vercel@latest
|
||||
- name: Pull Vercel Environment Information
|
||||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Build Project Artifacts
|
||||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Deploy Project Artifacts to Vercel
|
||||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||
|
|
|
|||
2
frontend/.gitignore
vendored
2
frontend/.gitignore
vendored
|
|
@ -4,5 +4,7 @@ dist
|
|||
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
.env
|
||||
.vercel
|
||||
|
|
|
|||
Loading…
Reference in a new issue