Skip to content

Set up deterministic GitBook-driven docs deployment - #20

Merged
mbwatson merged 1 commit into
stagecc:mainfrom
mbwatson:feature/docs-build-sync
Aug 12, 2026
Merged

Set up deterministic GitBook-driven docs deployment#20
mbwatson merged 1 commit into
stagecc:mainfrom
mbwatson:feature/docs-build-sync

Conversation

@mbwatson

@mbwatson mbwatson commented Jul 2, 2026

Copy link
Copy Markdown
Member

...with build-time sync and no content churn in this repo.

Added build-time GitBook sync pipeline in apps/docs/scripts/sync-gitbook.mjs to clone pinned content, transform GitBook markdown syntax, copy assets, generate sidebar, and emit manifest.

  • Runtime/build to generated navigation and sync-first flow:

    • apps/docs/astro.config.mjs now uses generated sidebar and disables default Starlight 404 route.
    • apps/docs/package.json now has sync:content, dev:sync, and sync-before-build behavior, with plain dev for fast local iteration.
  • Added safety/consistency controls:

    • Overwrite guard via GITBOOK_ALLOW_OVERWRITE=1.
    • Frontmatter title injection when missing.
    • Duplicate H1 removal when it matches frontmatter title.
    • Sidebar generation cleanup to avoid duplicate parent-as-child labels and prefer Overview.
  • Introduced pinned source-of-truth lock file:

    • Added apps/docs/gitbook.lock.json with GitBook repo + ref SHA.
    • Sync script now defaults to lock file repo/ref (env overrides still supported), including SHA checkout support.
  • Generated-artifact model:

    • Added apps/docs/.gitignore entries for synced docs content/assets and generated sidebar/manifest so content syncs are local/build artifacts.
    • Removed manual tracked sidebar and updated tests to validate generated sidebar (apps/docs/src/config/sidebar.test.ts; deleted apps/docs/src/config/sidebar.ts).
  • Added scheduled auto-sync CI in bdc-web:

    • New workflow .github/workflows/docs-gitbook-sync.yml checks GitBook main every 30 minutes (plus manual trigger), updates lock when changed, validates docs build, and commits only lock updates on success.
    • Trigger on schedule and workflow_dispatch only.

Note: Wow, lots of file changes! Most are simply deleting the now untracked docs content files.

...with build-time sync and no content churn in repo.

- Added build-time GitBook sync pipeline in apps/docs/scripts/sync-gitbook.mjs to clone pinned content, transform GitBook markdown syntax, copy assets, generate sidebar, and emit manifest.
- Runtime/build to generated navigation and sync-first flow:
  - apps/docs/astro.config.mjs now uses generated sidebar and disables default Starlight 404 route.
  - apps/docs/package.json now has sync:content, dev:sync, and sync-before-build behavior, with plain dev for fast local iteration.

- Added safety/consistency controls:
  - Overwrite guard via GITBOOK_ALLOW_OVERWRITE=1.
  - Frontmatter title injection when missing.
  - Duplicate H1 removal when it matches frontmatter title.
  - Sidebar generation cleanup to avoid duplicate parent-as-child labels and prefer Overview.

- Introduced pinned source-of-truth lock file:
  - Added apps/docs/gitbook.lock.json with GitBook repo + ref SHA.
  - Sync script now defaults to lock file repo/ref (env overrides still supported), including SHA checkout support.

- Generated-artifact model:
  - Added apps/docs/.gitignore entries for synced docs content/assets and generated sidebar/manifest so content syncs are local/build artifacts.
  - Removed manual tracked sidebar and updated tests to validate generated sidebar (apps/docs/src/config/sidebar.test.ts; deleted apps/docs/src/config/sidebar.ts).

- Added scheduled auto-sync CI in bdc-web:
  - New workflow .github/workflows/docs-gitbook-sync.yml checks GitBook main every 30 minutes (plus manual trigger), updates lock when changed, validates docs build, and commits only lock updates on success.
  - Trigger on schedule-only and workflow_dispatch only.

etc.
- avoid node 20
- organize imports and formatting
- shift action timing
- add docs site readme
@mbwatson
mbwatson force-pushed the feature/docs-build-sync branch from ce1ff6f to 377ac33 Compare August 5, 2026 17:14
@mbwatson
mbwatson requested a review from Amaru333 August 5, 2026 17:15
@mbwatson
mbwatson marked this pull request as ready for review August 5, 2026 19:10
@mbwatson
mbwatson merged commit 6f57f0f into stagecc:main Aug 12, 2026
5 checks passed
@mbwatson
mbwatson deleted the feature/docs-build-sync branch August 13, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants