Operations

How CI/CD, deploys, and secrets are configured for bitpilot.

CI Pipeline

A single workflow at .github/workflows/ci.yml runs on every push and every pull request. It replaces the previous test.yml.

Jobs

JobRuns OnPurpose
lintubuntu, Python 3.12ruff check .
typecheckubuntu, Python 3.12mypy python/bitpilot
testubuntu, Python 3.10/3.11/3.12pytest with [dev,agent,lightning] extras
docsubuntu, Python 3.12Generate metadata, build site docs, run contract tests
deploy-previewubuntuNetlify preview deploy (PRs only, after all checks pass)
deploy-productionubuntuNetlify production deploy (main branch only, after all checks pass)

Concurrency

Pushes to the same branch cancel in-progress runs:


concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Netlify Deploy

Required GitHub Secrets

Set these in Settings > Secrets and variables > Actions:

SecretDescriptionWhere to find it
NETLIFY_AUTH_TOKENPersonal access tokenNetlify User Settings > Applications > Personal access tokens
NETLIFY_SITE_IDSite identifierNetlify site dashboard > Site configuration > General > Site ID

The current site ID is b3067f9b-3399-4618-b99d-eef500f53c6b (from .netlify/state.json).

Publish Directory

The Netlify publish directory is site/. The CI pipeline builds site/docs/ from docs/.md and copies docs/api/.json into site/docs/api/ before deploying.

Deploy Flow


Push to main
  -> lint + typecheck + test + docs (parallel)
  -> all pass
  -> deploy-production: build site docs, netlify deploy --prod

Open PR
  -> lint + typecheck + test + docs (parallel)
  -> all pass
  -> deploy-preview: build site docs, netlify deploy (preview URL)

Preview URLs

PR preview deploys produce a unique URL visible in the GitHub Actions summary and as a PR comment (via the nwtgck/actions-netlify action).

Production URL

The production site is deployed to the URL configured in Netlify (e.g. bitpilot.space or the default *.netlify.app subdomain).

Rollback

To roll back a production deploy:

  1. Revert the commit and push to main — CI redeploys the previous state.
  2. Or use the Netlify dashboard: go to Deploys, find a previous successful deploy, and click Publish deploy.

Docs Metadata Drift

If you add a new public symbol to bitpilot.__all__ or a new CLI command, CI will fail at the docs job with a drift error. To fix:


python scripts/generate_docs_metadata.py
git add docs/api/
git commit -m "Update docs metadata"

Local Development


pip install -e ".[dev,agent,lightning]"
python scripts/generate_docs_metadata.py
python scripts/build_site_docs.py
python -m pytest tests/test_docs_contract.py -v

Open site/index.html in a browser to preview the homepage. Open site/docs/index.html for the docs.