Merge pull request #37 from willwearing/fix/sync-uncommitted-changes #38
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: CI & Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.6" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build shared package | |
| run: cd packages/shared && bun run build | |
| - name: Generate Prisma client | |
| run: cd backend && bun x prisma generate | |
| - name: Type check backend | |
| run: cd backend && bun x tsc -p tsconfig.build.json --noEmit | |
| - name: Type check frontend | |
| run: cd apps/web && bun x tsc --noEmit | |
| - name: Run backend tests | |
| run: cd backend && bun run test | |
| - name: Run frontend tests | |
| run: cd apps/web && bun run test | |
| deploy-backend: | |
| name: Deploy Backend | |
| needs: test | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Railway CLI | |
| run: npm install -g @railway/cli | |
| - name: Deploy backend to Railway | |
| run: railway up --service ${{ vars.RAILWAY_SERVICE_NAME }} | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| # Frontend deploys automatically via Vercel git integration |