
- Developers author Markdown and commit it alongside code (recommended).
- Backstage or a CI/CD job runs MkDocs / TechDocs generator to convert Markdown into HTML.
- Generated HTML is published to a storage backend (local filesystem, S3, GCS, etc.).
- When a user requests docs, Backstage reads and serves the stored HTML.

- Prepare — fetch the Markdown source from the repository (for example, GitHub).
- Generate — convert the Markdown into HTML (using MkDocs / TechDocs generator).
- Publish — store the generated HTML in a publisher backend.

Local builder behavior
- Backstage pulls the repository source, runs the generator (binary or Docker), generates HTML, and publishes it.
- Configure example:
builder: 'local' instructs Backstage to perform generation. If you use CI/CD to build docs, set builder: 'external' and ensure Backstage points to the published artifacts.
Build docs in CI/CD (external builder)
Offloading the generate step to CI/CD provides a controlled, repeatable build environment and reduces load on the Backstage instance. Typical flow:
- Developer pushes changes to
docs/ormkdocs.yml. - CI job installs TechDocs CLI and MkDocs, generates HTML, and publishes it to a storage backend (e.g., S3 or GCS).
- Backstage is configured to read the published artifacts from that storage.


main when docs/** or mkdocs.yml change.
Project example file tree:

mkdocs.yml
catalog-info.yaml
Add the backstage.io/techdocs-ref annotation to your entity metadata so Backstage can locate the docs. The dir: value should be relative to the catalog-info.yaml location.
Example catalog-info.yaml for a component:
Store
mkdocs.yml at the repository root and set backstage.io/techdocs-ref in catalog-info.yaml to point to your docs folder. This ensures TechDocs can find and build your documentation.- Keep docs close to code (e.g.,
docs/) for easier authoring and PR reviews. - Choose local or external builder based on scale, reproducibility, and resource constraints.
- Use S3 or GCS for scalable storage when publishing from CI/CD.
- Consider caching in Backstage for externally published docs to reduce storage reads.
- MkDocs: https://www.mkdocs.org
- Backstage TechDocs: https://backstage.io/docs/features/techdocs
- Amazon S3: https://aws.amazon.com/s3/
- Google Cloud Storage: https://cloud.google.com/storage
- TechDocs CLI: https://github.com/spotify/techdocs-cli
- TechDocs converts Markdown to HTML in three stages: prepare → generate → publish.
- Generation can run inside Backstage (local) or in CI/CD (external); configure
techdocs.builderaccordingly. - Publish generated HTML to a storage backend (local, S3, GCS) and configure Backstage to serve it.
- Add
backstage.io/techdocs-refincatalog-info.yamlto tell TechDocs where your docs live.