Repository navigation
implement test utils #528
Workflow file for this run
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: CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - synchronize | |
| workflow_dispatch: | |
| jobs: | |
| migrate-db: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.ref_name == 'main' && 'Staging' || 'Preview' }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5.0.0 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Check migrations | |
| run: pnpm run db:check | |
| - name: Load DB_URL from secrets | |
| run: echo "DB_URL=${{ secrets.DB_URL }}${{ github.ref_name != 'main' && '/pr' || '' }}${{ github.ref_name != 'main' && github.event.number || '' }}" >> $GITHUB_ENV | |
| - name: Migrate database | |
| run: pnpm run db:migrate |