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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
branches:
|
||||||
paths: ['frontend/**']
|
- main
|
||||||
|
paths:
|
||||||
|
- frontend/**
|
||||||
|
- .github/workflows/deploy_frontend.yml
|
||||||
|
|
||||||
|
env:
|
||||||
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||||
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
name: Deploy to Vercel
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 17
|
node-version: 18
|
||||||
cache: yarn
|
cache: yarn
|
||||||
cache-dependency-path: '**/yarn.lock'
|
cache-dependency-path: '**/yarn.lock'
|
||||||
- run: yarn install --immutable
|
- name: Install Vercel CLI
|
||||||
- run: yarn build
|
run: yarn global install vercel@latest
|
||||||
- id: auth
|
- name: Pull Vercel Environment Information
|
||||||
uses: google-github-actions/auth@v0
|
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
||||||
with:
|
- name: Build Project Artifacts
|
||||||
credentials_json: '${{ secrets.GCP_SA_KEY }}'
|
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||||
- id: deploy
|
- name: Deploy Project Artifacts to Vercel
|
||||||
uses: google-github-actions/deploy-appengine@v0
|
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||||
with:
|
|
||||||
working_directory: frontend
|
|
||||||
version: v1
|
|
||||||
|
|
|
||||||
2
frontend/.gitignore
vendored
2
frontend/.gitignore
vendored
|
|
@ -4,5 +4,7 @@ dist
|
||||||
|
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
tsconfig.tsbuildinfo
|
||||||
|
|
||||||
.env
|
.env
|
||||||
|
.vercel
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue