Skip to content

CI/CD

Forgejo Actions workflow at .forgejo/workflows/ci.yml. Runs on push to main and PRs to main.

Jobs

1. check

Code quality gate — runs on every trigger.

  1. Install Node.js and pnpm
  2. Install dependencies (pnpm install)
  3. Generate TypeScript types (api#prepare + web#prepare)
  4. Run pnpm run check (format + lint + typecheck)

2. test

Unit tests — runs on every trigger.

  1. Run monorepo tests (pnpm run test)
  2. Run API server tests
  3. Upload JUnit XML reports

3. e2e

End-to-end tests — depends on check passing.

Services: PostgreSQL 17 + Redis 7 (inline service containers).

TriggerTests Run
PR@smoke only (fast feedback)
Push to mainFull suite

Artifacts on failure:

  • Playwright HTML report
  • Test results (screenshots, videos, traces)

PR integration:

  • Test results posted as PR comment via Forgejo API

4. deploy-docs

Deploys VitePress documentation to Cloudflare Pages — runs on push to main only, depends on check passing.

  1. Build docs (pnpm run build:docs, which also builds the API for the OpenAPI spec)
  2. Deploy docs/.vitepress/dist via wrangler pages deploy

Secrets required: CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN

Environment Variables (CI)

NITRO_DATABASE_URL=postgresql://libris_test:libris_test@postgres:5432/libris_test
NITRO_REDIS_URL=redis://redis:6379
NITRO_INBOX_PATH=/tmp/e2e-inbox
NITRO_LIBRARY_PATH=/tmp/e2e-library
NITRO_API_SECRET_KEY=ci-e2e-test-secret-key-minimum-32-chars!
NUXT_SESSION_PASSWORD=ci-e2e-test-session-secret-32-chars-min
NUXT_API_BASE_URL=http://localhost:3000

Publish Images

Manual workflow at .forgejo/workflows/publish-images.yml. Builds and pushes Docker images to the Forgejo container registry.

Trigger: workflow_dispatch (run from Forgejo UI: Actions > Publish Images > Run workflow)

Jobs:

  1. version — Runs changeset version to bump package versions and update changelogs. Creates git tags (api/v<version>, web/v<version>) and Forgejo releases with changelogs.
  2. build — Builds and pushes Docker images.

Images produced:

  • git.lan.raz.wtf/raz/libris/api:v<version> + latest
  • git.lan.raz.wtf/raz/libris/web:v<version> + latest

See docs/deployment.md for production usage.

Docker Test Services

docker-compose.test.yml for local testing:

ServicePortConfig
PostgreSQL 175433DB: libris_test, tmpfs storage
Redis 76380tmpfs storage

Both use tmpfs for fast ephemeral storage.