Merge pull request #66 from trycompai/lewis/user-portal #38
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: Database Migrations | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: # Allows manual triggering | |
env: | |
BUN_VERSION: "1.0.26" | |
jobs: | |
migrate: | |
name: Run Database Migrations | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: ${{ env.BUN_VERSION }} | |
- name: Install dependencies | |
run: bun install | |
- name: Apply database migrations | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL_PROD }} | |
run: | | |
cd packages/db | |
bunx prisma migrate deploy | |
- name: Generate Prisma Client | |
run: | | |
cd packages/db | |
bunx prisma generate | |
- name: Run database seed | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL_PROD }} | |
run: | | |
cd packages/db | |
bunx prisma db seed |