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