# Deploying an Aftercare site Both recipes run `aftercare doctor` before publishing. Broken content, invalid section props, duplicate routes, and missing local images stop the deployment. Generate a recipe from the site root: ```powershell npx aftercare deploy github npx aftercare deploy netlify ``` Pass `--force` to replace an existing recipe file. ## GitHub Pages ```powershell npx aftercare deploy github ``` This writes `.github/workflows/aftercare-pages.yml`. Then: 1. Commit and push the workflow to `main`. 2. In the repository: **Settings → Pages → Source → GitHub Actions**. The workflow: 1. Installs dependencies 2. Runs `npx aftercare doctor` 3. Runs `npx aftercare build` with `AFTERCARE_BASE_PATH` set to `/` 4. Uploads `dist/` and deploys via GitHub Pages ### Base path Project Pages URLs look like `https://account.github.io/my-site/`. The recipe sets `AFTERCARE_BASE_PATH` to the repository name so asset and link paths resolve correctly. **Remove** that environment value (or set `basePath` empty in config) when using: - A custom domain - The special `account.github.io` user/organization site repository You can also set `basePath` in `aftercare.config.ts`; the env var wins when present. ## Netlify ```powershell npx aftercare deploy netlify ``` This writes `netlify.toml`. Then import the repository in Netlify and deploy. The recipe: - Build command: `npx aftercare doctor && npx aftercare build` - Publish directory: `dist` - Node version: 22 ## Manual / other hosts ```powershell npx aftercare doctor npx aftercare build ``` Upload the contents of `dist/` to any static host (S3, Cloudflare Pages, nginx, etc.). For hosting under a subpath, set: ```powershell $env:AFTERCARE_BASE_PATH = "/my-subpath" npx aftercare build ``` Or configure `basePath` in `aftercare.config.ts`. ## Pre-flight checklist - [ ] `npx aftercare doctor` reports zero errors - [ ] `AGENTS.md` is current (`npx aftercare sync` after theme changes) - [ ] Local images exist under `public/` and match content paths - [ ] Base path matches how the site will be served