Skip to content

Github actions to create dist in server #4

Github actions to create dist in server

Github actions to create dist in server #4

Workflow file for this run

name: Deploy to Vercel
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Vercel CLI
run: npm install -g vercel
- name: Link and pull Vercel project for frontend
run: |
vercel link --yes --token=${{ secrets.VERCEL_TOKEN }}
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./client
- name: Install frontend dependencies
run: npm install
working-directory: ./client
- name: Build frontend
run: npm run build
working-directory: ./client
- name: Deploy frontend to Vercel
run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
working-directory: ./client
- name: Link and pull Vercel project for backend
run: |
vercel link --yes --token=${{ secrets.VERCEL_TOKEN }}
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./server
- name: Install backend dependencies
run: npm install
working-directory: ./server
- name: Build backend
run: npm run build
working-directory: ./server
- name: Deploy backend to Vercel
run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
working-directory: ./server