Multi-instance Docusaurus 3 documentation portal for the TestBench Ecosystem by imbus AG. Each tool has its own documentation set with independent versioning.
imbus/ # GitHub org / parent folder
├── testbench-ecosystem-documentation/ # This repo (Docusaurus site)
│ ├── .github/workflows/
│ │ ├── release-pages.yml # Deploy to GitHub Pages on push to main
│ │ ├── pr-preview-surge.yml # Deploy PR previews to Surge.sh
│ │ └── version-tool-docs.yml # Create versioned docs from tool releases
│ └── docusaurus/
│ ├── docs/ # Global ecosystem docs (route: /docs/)
│ ├── <tool-id>/ # Tool "next" docs (git-ignored, synced for dev)
│ ├── <tool-id>_versions.json # Released versions (committed)
│ ├── <tool-id>_versioned_docs/ # Versioned doc snapshots (committed)
│ ├── <tool-id>_versioned_sidebars/ # Versioned sidebars (committed)
│ ├── sidebars_<tool-id>.ts # Tool sidebar definition
│ ├── tools.config.json # Tool metadata (label, description, logo)
│ ├── scripts/
│ │ ├── sync-docs.mjs # Copies docs from neighbor repos
│ │ └── add-tool.mjs # Interactive wizard for adding tools
│ ├── docusaurus.config.ts # Main site config (auto-discovers tools)
│ └── package.json
├── testbench-cli-reporter/ # Tool repo (neighbor)
│ └── docs/ # Documentation source
├── testbench-requirement-service/ # Tool repo (neighbor)
│ └── docs/ # Documentation source
└── ... # More tool repos
Important: Tool repositories must be cloned as siblings of this repo (same parent directory). The folder name of each tool repo must match its tool-id in tools.config.json.
All commands run from the docusaurus/ directory:
cd docusaurus
npm installnpm run devThis runs two things concurrently:
- sync:watch — copies the
docs/folder from each neighboring tool repo intodocusaurus/<tool-id>/and watches for changes. - docusaurus start — launches the dev server at
http://localhost:3000with hot reload.
When you edit files in a tool's docs/ folder, changes are automatically synced and the browser reloads.
# Via argument
npm run dev -- --repos testbench-cli-reporter
# Via environment variable
SYNC_REPOS=testbench-cli-reporter npm run dev| Command | Description |
|---|---|
npm run build |
Production build (only versioned/released tools) |
npm run start |
Dev server without doc syncing |
npm run serve |
Serve a production build locally |
npm run sync |
One-time sync from neighbor repos |
npm run typecheck |
TypeScript type checking |
npm run clear |
Clear Docusaurus cache |
npm run add-tool |
Interactive wizard to register a new tool |
| Variable | Description |
|---|---|
INCLUDE_NEXT=true |
Include unreleased ("next") docs in production builds |
SYNC_REPOS=tool1,tool2 |
Comma-separated list of tools to sync |
Run the interactive wizard:
cd docusaurus
npm run add-toolThis creates:
- An entry in
tools.config.json - A sidebar file
sidebars_<tool-id>.ts - A starter doc at
<tool-id>/intro.md
The tool auto-discovers from the sidebar file and appears in the Ecosystem navbar dropdown.
Alternatively, do it manually:
- Add the tool to
docusaurus/tools.config.json:{ "my-new-tool": { "label": "My New Tool", "description": "What the tool does.", "logo": "img/my-new-tool.svg" } } - Create
docusaurus/sidebars_my-new-tool.ts:const sidebars = { myNewToolSidebar: [{ type: 'autogenerated', dirName: '.' }], }; export default sidebars;
- Create
docusaurus/my-new-tool/intro.mdwith at least a title.
The tool repo must:
- Be in the same GitHub organization (
imbus). - Have a
docs/folder at its root with Docusaurus-compatible markdown. - Be named exactly like the
tool-idused in this repo.
Copy the file .github/workflows/trigger-docs-release.yml from an existing tool (e.g., testbench-cli-reporter) into the new tool's .github/workflows/ directory. No changes are needed — the workflow reads the tool-id from the repository name and the version from the release tag automatically.
The tool repo needs a secret called ECOSYSTEM_DOCS_TOKEN — a GitHub PAT (or fine-grained token) with permission to trigger repository_dispatch on testbench-ecosystem-documentation. This is best configured as an organization-level secret shared across all tool repos.
Each tool has independent versioning. Versioned files are committed to this repo; the "next" (current/unreleased) docs are git-ignored and synced from the tool repo during development.
When you create a GitHub release in a tool repository:
- The tool's
trigger-docs-release.ymlworkflow fires. - It sends a
repository_dispatchevent to this repo with the tool-id and version. - This repo's
version-tool-docs.ymlworkflow:- Downloads the
docs/folder from the release tag. - Runs
docusaurus docs:version:<tool-id> <version>to create a versioned snapshot. - Commits the versioned docs to a new branch and opens a PR.
- Downloads the
- The PR triggers a Surge.sh preview deployment for review.
- Merging the PR triggers a GitHub Pages production deployment.
┌──────────────┐ repository_dispatch ┌──────────────────────────┐
│ Tool repo │ ────────────────────────► │ ecosystem-docs repo │
│ (release) │ tool_id, version, tag │ version-tool-docs.yml │
└──────────────┘ └────────────┬─────────────┘
│
▼
Create branch + PR
│
▼
PR preview (Surge.sh)
│
▼
Merge → GitHub Pages
From the docusaurus/ directory:
npm run docusaurus -- docs:version:<tool-id> <version>Example:
npm run docusaurus -- docs:version:testbench-cli-reporter 1.3.0This snapshots the current docs from docusaurus/<tool-id>/ into versioned directories.
| Path | Content |
|---|---|
<tool-id>_versions.json |
Array of released version numbers |
<tool-id>_versioned_docs/version-X.Y.Z/ |
Frozen docs for that version |
<tool-id>_versioned_sidebars/version-X.Y.Z-sidebars.json |
Frozen sidebar for that version |
| Workflow | Trigger | Purpose |
|---|---|---|
release-pages.yml |
Push to main |
Build and deploy to GitHub Pages |
pr-preview-surge.yml |
Pull request events | Deploy preview to <repo>-pr-<number>.surge.sh |
version-tool-docs.yml |
repository_dispatch from tool repos |
Create versioned docs PR |
| Secret | Scope | Used by |
|---|---|---|
SURGE_TOKEN |
This repo | PR preview deployments |
ECOSYSTEM_DOCS_TOKEN |
Org-level (all repos) | Tool repos: trigger repository_dispatch. This repo: checkout private tool repos for docs download. |
The ECOSYSTEM_DOCS_TOKEN should be a fine-grained PAT (or classic PAT) with:
- Read access to contents of all tool repositories in the org
- Write access to trigger
repository_dispatchon this repo
Configuring it as an organization-level secret shared across all repos is the simplest approach.
- Tool doesn't appear in the Ecosystem dropdown: Ensure
sidebars_<tool-id>.tsexists anddocusaurus/<tool-id>/intro.mdexists. npm run devdoesn't sync a tool: The tool repo must be cloned as a sibling directory with a name matching the tool-id. Checktools.config.json.- Versioned tool doesn't show in production build: Only tools with at least one entry in
<tool-id>_versions.jsonare included in production builds. - Automated versioning PR not created: Check that
ECOSYSTEM_DOCS_TOKENis set in the tool repo and hasreposcope on this repo.