fix: mirgation db issue #1011
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
| # GitHub Actions workflow | |
| # https://help.github.com/actions | |
| name: CI/CD | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 7 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: "Environment" | |
| type: environment | |
| default: "test" | |
| required: true | |
| env: | |
| BUN_VERSION: latest | |
| VERSION: ${{ github.event.pull_request.number }} | |
| HUSKY: 0 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: "Build" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Configure Bun and install dependencies | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - run: bun install | |
| # Analyze code for potential problems | |
| - run: bun prettier --check . | |
| if: ${{ github.event_name == 'pull_request' }} | |
| - run: bun lint | |
| if: ${{ github.event_name == 'pull_request' }} | |
| # Type checking | |
| - run: bun email:build # Build email templates first | |
| - run: bun tsc --build | |
| # Testing (commented out - enable as needed) | |
| # - run: bun --filter @repo/web test | |
| # if: ${{ github.event_name == 'pull_request' }} | |
| # - run: bun --filter @repo/api test | |
| # if: ${{ github.event_name == 'pull_request' }} | |
| # - run: bun --filter @repo/app test | |
| # if: ${{ github.event_name == 'pull_request' }} | |
| # Build all workspaces | |
| - run: bun --filter @repo/web build | |
| - run: bun --filter @repo/api build | |
| - run: bun --filter @repo/app build | |
| # Validate Terraform configuration and formatting | |
| - uses: hashicorp/setup-terraform@v3 | |
| - run: terraform fmt -check -recursive infra/ | |
| # - run: terraform validate infra/environments/preview/ | |
| # Build Docker image (only on main branch pushes or manual triggers) | |
| - run: docker build --tag api:${{ github.sha }} -f ./apps/api/Dockerfile . | |
| - run: docker save api:${{ github.sha }} | gzip > api-image.tar.gz | |
| # Upload build artifacts | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: "build" | |
| path: "apps/web/dist\napps/app/dist\napps/api/dist\napi-image.tar.gz\n" | |
| deploy-preview: | |
| name: "Deploy" | |
| needs: [build] | |
| if: github.event_name == 'pull_request' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| name: Preview | |
| environment: preview | |
| url: https://{codename}.example.com | |
| secrets: inherit | |
| permissions: | |
| deployments: write | |
| pull-requests: read | |
| deploy-staging: | |
| name: "Deploy" | |
| needs: [build] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| name: Staging | |
| environment: staging | |
| url: https://staging.example.com | |
| secrets: inherit | |
| permissions: | |
| deployments: write | |
| pull-requests: read | |
| deploy-prod: | |
| name: "Deploy" | |
| needs: [build] | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| name: Production | |
| environment: production | |
| url: https://example.com | |
| secrets: inherit | |
| permissions: | |
| deployments: write | |
| pull-requests: read |