added sitemap #10
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ── Backend tests ────────────────────────────────────────────────────────── | |
| backend: | |
| name: Backend tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| cache-dependency-path: backend/requirements-dev.txt | |
| - name: Install dependencies | |
| run: pip install -r requirements-dev.txt | |
| - name: Run tests | |
| env: | |
| GROQ_API_KEY: test-key # real key not needed — LLM calls are mocked | |
| run: pytest tests/ -v --tb=short | |
| # ── Frontend tests ───────────────────────────────────────────────────────── | |
| frontend: | |
| name: Frontend tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| # ── Deploy backend to Render ─────────────────────────────────────────────── | |
| deploy-backend: | |
| name: Deploy backend → Render | |
| needs: [backend, frontend] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Trigger Render deploy | |
| env: | |
| RENDER_DEPLOY_HOOK_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} | |
| run: | | |
| if [ -z "$RENDER_DEPLOY_HOOK_URL" ]; then | |
| echo "⚠️ RENDER_DEPLOY_HOOK_URL secret not set — skipping deploy" | |
| exit 0 | |
| fi | |
| curl -sf -X POST "$RENDER_DEPLOY_HOOK_URL" | |
| echo "✅ Render deploy triggered" | |
| # ── Deploy frontend to Vercel ────────────────────────────────────────────── | |
| deploy-frontend: | |
| name: Deploy frontend → Vercel | |
| needs: [backend, frontend] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Vercel CLI | |
| run: npm install -g vercel | |
| - name: Deploy to Vercel | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| working-directory: frontend | |
| run: | | |
| if [ -z "$VERCEL_TOKEN" ]; then | |
| echo "⚠️ VERCEL_TOKEN secret not set — skipping deploy" | |
| exit 0 | |
| fi | |
| vercel --prod --token "$VERCEL_TOKEN" --yes |