add average rating calculator #8
Workflow file for this run
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: CI Build | |
on: | |
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 frontend node modules | |
uses: actions/cache@v3 | |
with: | |
path: frontend/node_modules | |
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-frontend- | |
- name: Cache backend node modules | |
uses: actions/cache@v3 | |
with: | |
path: backend/node_modules | |
key: ${{ runner.os }}-backend-${{ hashFiles('backend/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-backend- | |
- name: Install dependencies (frontend) | |
run: npm install | |
working-directory: frontend | |
- name: Install dependencies (backend) | |
run: npm install | |
working-directory: backend | |
- name: Build frontend | |
run: npm run build | |
working-directory: frontend | |
- name: Build backend | |
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 |