Merge pull request #11 from allthingsweb-dev/cursor/automate-db-migra… #1
This file contains hidden or 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: Run Drizzle migrations on main when schema or migrations change | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'app/src/lib/schema.ts' | |
| - 'app/migrations/**' | |
| jobs: | |
| migrate: | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies (app) | |
| working-directory: app | |
| run: bun install | |
| - name: Run migrations | |
| working-directory: app | |
| run: bun run db:migrate |