Merge pull request #594 from Perdolique/next-iteration #171
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: Database migration | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| types: | |
| - opened | |
| - synchronize | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| migration: | |
| runs-on: ubuntu-24.04 | |
| environment: ${{ github.event_name == 'pull_request' && 'staging' || 'production' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - uses: Perdolique/automations/.github/actions/setup-pnpm@v1.0.4 | |
| with: | |
| install-dependencies: true | |
| - name: Run database migration | |
| env: | |
| NUXT_DATABASE_URL: ${{ secrets.NUXT_DATABASE_URL }} | |
| run: pnpm run db:migrate | |
| - name: Seed database | |
| if: github.event_name == 'pull_request' | |
| env: | |
| NUXT_DATABASE_URL: ${{ secrets.NUXT_DATABASE_URL }} | |
| run: pnpm run db:seed |