Repository navigation
Made the app theme configurable per organization #790
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@v7 | |
| - 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: Ensure preview database exists | |
| if: github.ref_name != 'main' | |
| run: | | |
| psql "${{ secrets.DB_URL }}/postgres" -tAc "SELECT 1 FROM pg_database WHERE datname = 'pr${{ github.event.number }}'" | grep -q 1 || \ | |
| psql "${{ secrets.DB_URL }}/postgres" -c 'create database "pr${{ github.event.number }}";' | |
| - name: Migrate database | |
| run: pnpm run db:migrate |