PDF-accessibility-saas/.forgejo/workflows/ci.yml
Vadym Samoilenko 5cbbcc6e5e
Some checks are pending
CI / Backend — lint + test (push) Waiting to run
CI / Frontend — lint + typecheck (push) Waiting to run
CI / Build + push Docker images (push) Blocked by required conditions
Phase 4–6: Next.js frontend, production deploy, CI/CD
Frontend (Next.js 15 + shadcn/ui + Tailwind, Supabase Auth):
- Landing page: hero, feature grid, social proof (EU Accessibility Act), CTA
- Pricing page: Free / Pro $29 / Business $149 with highlighted Pro tier
- Auth: magic link login + signup (Supabase OTP, no password)
- App layout: sidebar nav (Dashboard, History, Billing, Team)
- Dashboard: drag-and-drop PDF upload with quota error handling
- Jobs history: table with score badges and status indicators
- Billing: Stripe Checkout + Customer Portal integration
- Supabase SSR client/server helpers

Deploy:
- docker-compose.prod.yml: postgres, redis, minio, api, celery, nextjs, caddy
- Caddyfile: auto-SSL for pdfaccess.ai-impress.com
- Watchtower excluded (locally-built images)

CI/CD (Forgejo Actions):
- backend-lint-test: pytest with real postgres + redis
- frontend-lint: tsc typecheck
- build-and-push: docker build → push to registry.ai-impress.com
- SSH deploy to homelab on push to main

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:51:14 +01:00

110 lines
3 KiB
YAML

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
backend-lint-test:
name: Backend — lint + test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: pdf_accessibility_test
POSTGRES_USER: pdf_accessibility
POSTGRES_PASSWORD: testpassword
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Install uv
run: pip install uv
- name: Install dependencies
working-directory: backend
run: uv sync
- name: Run tests
working-directory: backend
env:
DB_HOST: localhost
DB_NAME: pdf_accessibility_test
DB_USER: pdf_accessibility
DB_PASSWORD: testpassword
REDIS_URL: redis://localhost:6379/0
STORAGE_ENDPOINT: http://localhost:9000
ANTHROPIC_API_KEY: test-key
SUPABASE_JWT_SECRET: test-secret
ENVIRONMENT: development
run: uv run pytest tests/ -v --tb=short
frontend-lint:
name: Frontend — lint + typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install deps
working-directory: frontend
run: npm ci
- name: Typecheck
working-directory: frontend
run: npx tsc --noEmit
build-and-push:
name: Build + push Docker images
runs-on: ubuntu-latest
needs: [backend-lint-test, frontend-lint]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Login to registry
uses: docker/login-action@v3
with:
registry: registry.ai-impress.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build + push API
uses: docker/build-push-action@v6
with:
context: .
file: backend/Dockerfile
push: true
tags: registry.ai-impress.com/pdf-accessibility/api:latest
- name: Build + push Frontend
uses: docker/build-push-action@v6
with:
context: frontend
file: frontend/Dockerfile
push: true
tags: registry.ai-impress.com/pdf-accessibility/frontend:latest
- name: Deploy to homelab
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd /opt/pdf-accessibility
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
docker system prune -f