Skip to content

small change

small change #2

Workflow file for this run

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
run: |
curl -s -X POST "${{ secrets.RENDER_DEPLOY_HOOK_URL }}" \
-H "Content-Type: application/json" \
--fail
# Set RENDER_DEPLOY_HOOK_URL in GitHub repo secrets
# Get it from: Render dashboard → your service → Settings → Deploy Hook
# ── 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
working-directory: frontend
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: vercel --prod --token=$VERCEL_TOKEN --yes