> ## Documentation Index
> Fetch the complete documentation index at: https://docs.earthcare.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy

> How code reaches the test and production environments.

ECN deploys from git. Pushing to the `test` branch ships the integration
environment; production is promoted from there.

## Branches → environments

| Branch | Environment              | Trigger                                                            |
| ------ | ------------------------ | ------------------------------------------------------------------ |
| `test` | `test.earthcare.network` | Push to `test` → Railway (backend) + Vercel (frontend) auto-deploy |
| `main` | `earthcare.network`      | Promote `test → main`                                              |

## CI gates

Every push runs CI (`.github/workflows/ci.yml`):

1. **Backend** — run migrations, check migrations are committed
   (`makemigrations --check`), and run `pytest`.
2. **Frontend** — `npm run build`.
3. **Staging smoke** (on `test` pushes) — `scripts/qa-test-staging.sh` runs health,
   config, and page checks against the deployed test site with retries.

Nothing reaches an environment until CI is green.

<Note>
  The docs site itself deploys via Mintlify's GitHub app from `docs-site/` to
  `docs.earthcare.network` — independent of the app's Railway/Vercel pipeline.
</Note>
