Merge pull request #425 from Merit-Systems/master #23
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: Migrate Database | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master, production] | |
| paths: | |
| - 'packages/app/control/prisma/**' | |
| jobs: | |
| migrate-staging: | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.11.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --filter echo-control | |
| working-directory: ./packages/app/control | |
| - name: Run Prisma migrate deploy (Staging) | |
| run: pnpm run prisma:migrate-deploy | |
| working-directory: ./packages/app/control | |
| env: | |
| DATABASE_URL: ${{ secrets.STAGING_DB_URL }} | |
| migrate-production: | |
| if: github.ref == 'refs/heads/production' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.11.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --filter echo-control | |
| working-directory: ./packages/app/control | |
| - name: Run Prisma migrate deploy (Production) | |
| run: pnpm run prisma:migrate-deploy | |
| working-directory: ./packages/app/control | |
| env: | |
| DATABASE_URL: ${{ secrets.PRODUCTION_DB_URL }} |