Implement format with prettier #28
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: Deploy to Vercel | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "21.2.0" | |
- name: Install frontend dependencies | |
run: npm install | |
working-directory: ./client | |
- name: Build frontend | |
run: npm run build | |
working-directory: ./client | |
- name: Upload frontend build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-build | |
path: ./client/dist | |
build-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "21.2.0" | |
- name: Install backend dependencies | |
run: npm install | |
working-directory: ./server | |
- name: Build backend | |
run: npm run build | |
working-directory: ./server | |
- name: Upload backend build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: backend-build | |
path: ./server/public | |
deploy-both: | |
needs: [build-frontend, build-backend] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Vercel CLI | |
run: npm install -g vercel@latest | |
# Frontend deployment | |
- name: Download frontend build | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-build | |
path: ./client/build | |
- name: Deploy frontend | |
run: | | |
vercel link --yes --project ${{ secrets.FRONTEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} | |
vercel --token ${{ secrets.VERCEL_TOKEN }} | |
working-directory: ./client | |
# Backend deployment | |
- name: Download backend build | |
uses: actions/download-artifact@v3 | |
with: | |
name: backend-build | |
path: ./server/public | |
- name: Deploy backend | |
run: | | |
vercel link --yes --project ${{ secrets.BACKEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} | |
vercel --token ${{ secrets.VERCEL_TOKEN }} | |
working-directory: ./server |