How we build and publish https://autofixture.com from this repo using GitHub Pages + GitHub Actions (Option A).
| Stage | What happens |
|---|---|
| API gen | node api-gen/run.mjs prepare downloads pinned NuGet packages, runs DocFX, writes markdown + meta into site/public/ (not committed) |
| Site | npm run generate in site/ prerenders docs + API routes to site/.output/public |
| Host | actions/upload-pages-artifact + actions/deploy-pages publish that folder |
Custom domain: site/public/CNAME → autofixture.com (must be in the uploaded artifact root).
| Workflow | File | When | Purpose |
|---|---|---|---|
| CI | .github/workflows/ci.yml |
Pull requests to master |
Same build as production; no deploy |
| Deploy | .github/workflows/deploy.yml |
Push to master, or manual workflow_dispatch |
Build + publish to Pages |
Shared build steps live in .github/actions/build-site/.
Do this once (org admin / repo admin):
- Open Settings → Pages.
- Under Build and deployment → Source, choose GitHub Actions (not “Deploy from a branch”).
- Confirm custom domain is
autofixture.com(already set in Pages; keepCNAMEfiles in sync). - After the first successful Actions deploy and DNS is correct, enable Enforce HTTPS.
- Optional: under Environments → github-pages, require reviewers if you want a human gate before production publishes.
No deploy secrets are required for public NuGet + public Pages.
- Open a PR → CI must pass (build only).
- Merge to
master→ Deploy runs automatically. - Check the Actions run, then open https://autofixture.com (or the
page_urlfrom the deploy job).
Manual republish (same commit, no code change):
gh workflow run Deploy --repo AutoFixture/AutoFixture.github.ioOr: Actions → Deploy → Run workflow.
Approximate what CI does:
# Needs: Node 22+, .NET SDK 8+, DocFX (`dotnet tool install -g docfx`)
node api-gen/run.mjs prepare
npm ci --prefix site
npm run generate --prefix site
# Static output: site/.output/publicOr with just:
just prepare-api
just site-install
just site-generatePreview the static output:
npx --prefix site serve site/.output/publicGitHub Pages keeps recent deployments. Options:
- Re-run a previous successful Deploy workflow run (Actions → that run → Re-run all jobs), if the commit still matches what you want.
- Revert the bad commit on
masterand push (triggers a new good deploy). - Checkout an older commit and use workflow_dispatch only if you temporarily point the workflow at that ref (prefer revert for clarity).
Versions are pinned in api-gen/packages.json. To refresh API docs after a NuGet release:
- Edit versions in
api-gen/packages.json. - Run
node api-gen/run.mjs preparelocally and spot-check. - PR → merge → Deploy regenerates API in CI (no generated files in git).
- Canonical:
autofixture.com→ GitHub Pages (A/AAAA+wwwCNAME toautofixture.github.io). - Aliases:
autofixture.io,.net,.org→ permanent redirect tohttps://autofixture.com/(Namecheap URL Redirect is HTTP-only; HTTPS redirects planned via Cloudflare DNS later). - One custom domain per Pages site. Keep both
CNAME(repo root) andsite/public/CNAMEequal toautofixture.comso Actions deploys do not overwrite Pages back to an old domain.
| Symptom | Likely cause | What to try |
|---|---|---|
| Deploy fails: Pages source | Still on “Deploy from a branch” | Switch Source to GitHub Actions |
| 403 on deploy | Missing pages: write / id-token: write |
Check deploy.yml permissions |
| Missing / wrong domain | CNAME not in artifact or still .io |
Ensure site/public/CNAME is autofixture.com |
| DocFX not found | Tool not on PATH | Composite action installs DocFX and adds ~/.dotnet/tools |
| Slow builds | Cold NuGet cache | Wait for api-gen/packages-cache cache hit on next run |
| API page empty after client nav | Server route not available on static host | Prefer full page load / prerendered routes; open an issue if a route was not prerendered |
| HTTPS cert pending | New custom domain | Wait for Let’s Encrypt; then Enforce HTTPS |
- Pages source set to GitHub Actions
- Pages custom domain is
autofixture.com+ Enforce HTTPS -
CNAMEandsite/public/CNAMEareautofixture.com - PR CI green on a test PR
- Merge to
master(orworkflow_dispatch) succeeds - https://autofixture.com serves the Nuxt site (not the old Jekyll site)
- Spot-check
/docs/...and a few/api/...deep links - Confirm
.io/.net/.orgredirect to.com(HTTPS via Cloudflare later if needed)