Update next, use postgres-js #7
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 Ops Database | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release | |
| paths: | |
| - 'ops/drizzle/**' | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Environment to migrate' | |
| required: true | |
| type: choice | |
| options: | |
| - staging | |
| - prod | |
| jobs: | |
| migrate-staging: | |
| name: Run Staging Ops Migration | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| environment: staging | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run ops migration (Staging) | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| DATABASE_SSL: ${{ secrets.DATABASE_SSL }} | |
| run: bun run migrate:ops | |
| migrate-prod: | |
| name: Run Prod Ops Migration | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| environment: prod | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/release') || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'prod') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run ops migration (prod) | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| DATABASE_SSL: ${{ secrets.DATABASE_SSL }} | |
| run: bun run migrate:ops |