Skip to content

Commit

Permalink
Update build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Somnath-Chattaraj authored Jul 29, 2024
1 parent 8fbfbfe commit c374229
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build and Migrate
name: CI Build

on:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -22,29 +19,44 @@ jobs:
node-version: '20'
cache: 'npm'

- name: Cache Node modules
- name: Cache Node modules (frontend)
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 Node modules (backend)
uses: actions/cache@v3
with:
path: |
./backend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('backend/package-lock.json') }}
path: backend/node_modules
key: ${{ runner.os }}-backend-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-backend-
- name: Install dependencies (frontend)
run: npm install
working-directory: frontend

- name: Install dependencies
- name: Install dependencies (backend)
run: npm install
working-directory: ./backend
working-directory: backend

- name: Build frontend
run: npm run build
working-directory: frontend

- name: Build code
- name: Build backend
run: npm run build
working-directory: ./backend
working-directory: backend

- name: Set up Prisma
run: npx prisma generate
working-directory: ./backend
working-directory: backend

- name: Run Prisma Migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
working-directory: ./backend
working-directory: backend

0 comments on commit c374229

Please sign in to comment.