Skip to content

Update build.yaml

Update build.yaml #4

Workflow file for this run

name: Build and Migrate
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Cache Node modules
uses: actions/cache@v3
with:
path: |
./backend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
working-directory: ./backend
- name: Build code
run: npm run build
working-directory: ./backend
- name: Set up Prisma
run: npx prisma generate
working-directory: ./backend
- name: Run Prisma Migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
working-directory: ./backend