Repository navigation
fix(api): export JSON schemas from pydantic models and publish schema index (fixes #32) #100
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
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| api: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/api | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_USER: hackproof | |
| POSTGRES_PASSWORD: hackproof | |
| POSTGRES_DB: hackproof | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U hackproof" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| DATABASE_URL: postgresql://hackproof:hackproof@localhost:5432/hackproof | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: apps/api/uv.lock | |
| - run: uv sync --frozen | |
| - run: uv run ruff check . | |
| - run: uv run ruff format --check . | |
| - run: uv run pytest | |
| web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| - run: pnpm format:check | |
| - run: pnpm build | |
| deploy-api: | |
| needs: api | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| api: | |
| - 'apps/api/**' | |
| - 'config/**' | |
| - 'railway.json' | |
| - if: steps.changes.outputs.api == 'true' | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| run: | | |
| if [ -z "$RAILWAY_TOKEN" ]; then | |
| echo "::warning::RAILWAY_TOKEN is not set, skipping the deploy" | |
| exit 0 | |
| fi | |
| npm install --global @railway/cli | |
| railway up --service api --ci |