Skip to content

Commit

Permalink
build: 💚 update vercel config
Browse files Browse the repository at this point in the history
  • Loading branch information
lehuygiang28 committed Jun 9, 2024
1 parent fd8bb43 commit 16e7415
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to Vercel

on:
push:
branches: [config_vercel] # Production deployment
branches-ignore: [config_vercel] # Preview deployments for all other branches

jobs:
# deploy-frontend:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install dependencies
# run: yarn install
# - name: Build frontend
# run: yarn nx build fe
# - name: Install Vercel CLI
# run: npm install -g vercel
# - name: Pull Vercel cache
# uses: actions/cache@v3
# with:
# path: ~/.vercel
# key: ${{ runner.os }}-vercel-fe-${{ hashFiles('vercel.json') }}
# - name: Deploy frontend with Vercel
# run: vercel --prod -s tasktr-fe ${{ github.ref != 'refs/heads/main' && '--prebuilt' || '' }}
# env:
# VERCEL_TOKEN: ${{ secrets.VERCEL_ACCESS_TOKEN }}
deploy-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn install
- name: Build backend
run: yarn nx build be && yarn nx build fe
- name: Install Vercel CLI
run: npm install -g vercel
- name: Pull Vercel cache
uses: actions/cache@v3
with:
path: ~/.vercel
key: ${{ runner.os }}-vercel-be-${{ hashFiles('vercel.json') }}
- name: Deploy backend with Vercel
run: vercel --prod -s tasktr-be ${{ github.ref != 'refs/heads/main' && '--prebuilt' || '' }}
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_ACCESS_TOKEN }}
21 changes: 21 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"github": {
"enabled": false
},
"functions": {
"dist/apps/be/main.js": {
"runtime": "nodejs"
}
},
"rewrites": [
{
"source": "/be/api/(.*)",
"destination": "/api/$1"
},
{
"source": "/(.*)",
"destination": "/fe/$1"
}
]
}

1 comment on commit 16e7415

@vercel
Copy link

@vercel vercel bot commented on 16e7415 Jun 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.