GitHub Pages publishing for the NutsNews wiki
Section titled “GitHub Pages publishing for the NutsNews wiki”The repository is the source of truth. Astro/Starlight builds a pure-static artifact, Pagefind indexes it, and the pinned .github/workflows/wiki-pages.yml workflow deploys it to GitHub Pages.
Current pre-cutover state
Section titled “Current pre-cutover state”- Default HTTPS URL:
https://ramideltoro.github.io/nutsnews-docs/ - Release target:
pre-cutoverinscripts/wiki/wiki-release.json - Build site/base:
https://ramideltoro.github.ioand/nutsnews-docs - Pages custom domain: not set until the production cutover
- Production destination:
https://wiki.nutsnews.com/
The tracked root CNAME records the intended hostname, but the pre-cutover artifact must not contain a CNAME file or claim the custom domain.
Owned paths
Section titled “Owned paths”The publishing contract is implemented by:
.github/workflows/wiki-pages.ymlastro.config.mjsplaywright.config.mjspackage.jsonandpackage-lock.jsonscripts/wiki/wiki-release.jsonscripts/wiki/validate-pages-artifact.mjsscripts/wiki/validate-wiki-budgets.mjsscripts/wiki/validate-wiki-secrets.mjstests/wiki/reader-journeys.spec.mjsCNAME
Canonical Markdown, Simple/Technical mirrors, diagrams, and approval metadata are sources. src/content/docs/, _site/, playwright-report/, test-results/, caches, and the generated inventory are outputs; do not edit or commit them.
Local preview
Section titled “Local preview”Install the locked dependencies:
npm ciFor an authoring preview:
npm run dev -- --host 127.0.0.1 --port 4321For a root-form production preview:
npm run buildnpm run preview -- --host 127.0.0.1 --port 4321For the actual pre-cutover project-path artifact:
WIKI_SITE_URL=https://ramideltoro.github.io WIKI_BASE_PATH=/nutsnews-docs npm run buildnpm run wiki:release:stamp -- --sha="$(git rev-parse HEAD)"WIKI_SITE_URL=https://ramideltoro.github.io WIKI_BASE_PATH=/nutsnews-docs npm run validate:pages-artifact -- --sha="$(git rev-parse HEAD)"npm run preview -- --host 127.0.0.1 --port 4321Open http://127.0.0.1:4321/nutsnews-docs/ for that project-path preview.
Local validation
Section titled “Local validation”Run these commands from the repository root:
npm run wiki:preparenpm run validate:contentnpm run validate:linksnpm run validate:mermaidnpm run test:content-routesnpm run test:workflownpm run test:pages-artifactnpm run test:browsernpm run buildThe complete content gate checks all 227 canonical sources, both 227-file mirror sets, current human approvals, 227 accessible diagrams, unique routes/orders, links/fragments, images, and orphans. Broken fixtures must exit nonzero.
GitHub Actions order
Section titled “GitHub Actions order”The workflow runs for every pull request, relevant push to main, and manual workflow_dispatch. Superseded runs on the same ref cancel. Every GitHub-authored Action is pinned to a full release SHA.
Pull request
Section titled “Pull request”Only the quality job runs. It installs with npm ci, exercises authoring and broken fixtures, validates source/content/link/secret/Mermaid contracts, builds the root-form site, enforces budgets, validates built surfaces, and runs the three-viewport Playwright/axe/visual suite. A passing PR does not deploy.
Push or manual run on main
Section titled “Push or manual run on main”- The quality job completes and emits
validated_shaonly after every gate passes. - The build job depends on that output, checks out the exact SHA, and verifies both
GITHUB_SHAandgit rev-parse HEAD. - Astro builds with the allowlisted site/base for the current release target.
release.jsonis stamped with the exact validated SHA.- Budgets and
validate:pages-artifactinspect the final upload directory. - The pinned Pages artifact Action uploads
_site/. - The deploy job, restricted to
mainby thegithub-pagesenvironment, deploys that artifact.
Global token access is contents: read. Only the deploy job has pages: write and id-token: write. Publishing consumes no repository secret and no OpenAI key; the mocked drafting test receives an empty key. Failure-only browser artifacts contain only the two Playwright output directories, exclude hidden files, and expire after seven days.
Launch gate and production cutover
Section titled “Launch gate and production cutover”Do not start the cutover until all platform issues and local launch QA are complete and the default URL passes public smoke tests.
-
Prepare a normal site-code pull request that changes the release target from project Pages to production root:
.github/workflows/wiki-pages.yml:WIKI_SITE_URL=https://wiki.nutsnews.com,WIKI_BASE_PATH=/scripts/wiki/wiki-release.json: modeproduction, site URLhttps://wiki.nutsnews.com, base/, public URLhttps://wiki.nutsnews.com/scripts/wiki/validate-pages-artifact.mjsand its tests: accept and enforce the production target
-
Validate that pull request completely, but do not merge it yet.
-
In Cloudflare, add or update only this DNS record:
Type Name Target Proxy CNAME wikiramideltoro.github.ioDNS only Do not add, delete, or modify any other DNS record.
-
Merge the validated production-target pull request. Wait for its root-form Pages artifact to deploy successfully.
-
In repository Settings → Pages, set the custom domain to
wiki.nutsnews.com. Do not change the Actions build source. -
Wait for GitHub Pages to approve the certificate, then enable Enforce HTTPS.
-
Verify DNS, HTTPS, the exact release stamp, root routing, both audiences, search/History, diagrams, 404, and representative nested pages before declaring launch complete.
Useful read-only checks:
dig +short CNAME wiki.nutsnews.comcurl --fail --location --silent --show-error https://wiki.nutsnews.com/release.jsoncurl --fail --location --silent --show-error --output /dev/null https://wiki.nutsnews.com/simple/project/curl --fail --location --silent --show-error --output /dev/null https://wiki.nutsnews.com/technical/project/Rollback
Section titled “Rollback”Rollback verification contract
Section titled “Rollback verification contract”Record the last-good commit SHA before either rollback path. Verify https://wiki.nutsnews.com serves that stamped SHA after a production rollback and smoke both audiences; after a cutover fallback, verify the default project URL instead.
Bad content or site release
Section titled “Bad content or site release”- Identify the last successful production run and its stamped commit.
- Revert the bad commit on
mainthrough the contribution workflow that applies to the changed paths, or rerun the last known-good workflow run. - Require quality, exact-SHA, artifact, and deploy jobs to pass.
- Confirm
release.jsonreports the intended commit, then smoke both audiences and the affected routes.
Failed custom-domain cutover
Section titled “Failed custom-domain cutover”- Redeploy the last successful pre-cutover commit so the artifact again uses
/nutsnews-docs. - Remove the repository Pages custom domain and verify
https://ramideltoro.github.io/nutsnews-docs/. - Remove or correct only the
wikiCNAME if DNS itself caused the failure; leave every other DNS record unchanged. - Diagnose and repeat the full cutover gate instead of patching deployed HTML.
Failure handling
Section titled “Failure handling”| Failure stage | Check first |
|---|---|
| Quality | stale approval, incomplete inventory, mirror/diagram/link defect, broken fixture, axe/visual failure |
| Exact build | missing validated_sha, mismatched checkout SHA, wrong site/base, Astro or Pagefind failure |
| Artifact | secret/env/source file, hidden path, symlink, CNAME claim, wrong stamp, missing route, budget |
| Deploy | main environment policy, Pages status, deployment-only permissions, artifact availability |
| Default URL | project base /nutsnews-docs, asset paths, root audience redirect, release stamp |
| Custom domain | the single DNS-only CNAME, Pages custom-domain state, certificate state, HTTPS enforcement |
Fix the source, config, or external setting and rerun the complete workflow. Never edit deployed HTML, weaken a gate, expose logs/artifacts containing secrets, or use obsolete .wiki-build, wiki-push, Jekyll, or bundle commands.
