Skip to content

Set up deterministic GitBook-driven docs deployment#20

Draft
mbwatson wants to merge 1 commit into
stagecc:mainfrom
mbwatson:feature/docs-build-sync
Draft

Set up deterministic GitBook-driven docs deployment#20
mbwatson wants to merge 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 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.

avoid node 20

organize imports and formatting

organize imports and formatting

shift action timing

comment git sync script functions

add docs site readme
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.

1 participant