Skip to content

docs: implement publishing pipeline #617

Closed

Description

@planetf1

The problem

Mintlify is currently configured with no build step — it reads files directly from a branch (main for prod, update-docs for preview). This works perfectly for the hand-authored static content in PR #601.

PR #611 introduces a generated API reference that cannot follow the same model. The docs are built from Python source by tooling/docs-autogen/ and must be regenerated on every release. They are excluded from git tracking (.gitignore) precisely so they are never hand-edited or accidentally committed.

The tension: Mintlify will never see the API docs unless we either add a build step or commit the generated output somewhere it can read from.

Options

A — Commit generated output on each release (minimal change)
Keep docs-autogen-pr.yml: CI generates the API docs on each tag and commits them via a PR. Mintlify needs no config change. Generated files re-enter the repo on every release — requires the .gitignore approach in #611 to be revisited (or replaced with a convention).

B — Dedicated publish branch (clean, more work)
A docs-publish branch is never directly committed to. On each release, CI combines the static content from main with freshly generated API docs and pushes the result to docs-publish. Mintlify is reconfigured to read from that branch. main stays clean. Requires a Mintlify config change and a pipeline step to carry the static content across.

C — Mintlify custom build step (investigate)
If Mintlify supports running an arbitrary build command, the pipeline could run there with no branch changes needed. Needs investigation.

When to decide

After PR #601 and PR #611 have both merged, since the Mintlify branch config and the .gitignore boundary are established by those PRs respectively. Option B is the cleanest long-term answer; Option A is lowest friction to unblock publishing.

Activity

  1. added
    documentation
    on Mar 11, 2026
  2. planetf1 commented on Mar 11, 2026

    @planetf1
    ContributorAuthor
    • API docs don't really exist as a permanent asset,. They are generated through a pipeline. So the source is in main (etc) and we 'publish' by running the pipeline and writing the output into a docs branch (such as staging-docs). We can identify source/target pairs so may actually be better to have branch names like docs/staging and docs/production
    • The conceptual docs (etc) currently are 'developed' alongside code as usual. The authoritative source stays with the code - ie gets merged into main etc. We still run a pipeline to 'publish' but effectively this is just going to copy the files into docs/staging or docs/production.
    • if we use mkdocs in future we would do similar for the published github pages
    • In both cases the CI action will use docs/staging for merges into main, and docs/production for release tags
    • We also always colocate the source content with the code. (easiest for refactors and CI verification)

    I'm ok to set this up, though wanted to get agreement. I don't think I'll need repo admin, but will need to have mintlify access, or for someone else to change the source mintlify reads from

    A further tweak is to make this version specific but I don't know how mintlify handles this - can look, but probably simplest to skip until after release.

  3. psschwei commented on Mar 11, 2026

    @psschwei
    Contributor

    Just to level-set a bit:

    For the short term, we need to publish the API for v0.4

    For the middle term, we need to be able to:

    • publish the updated API for the next release
    • keep old versions of the API docs corresponding to each release
    • have a "dev" version of the docs that tracks main

    In the middle to long term, we also want to revisit the tooling we are using to publish the docs and where they are hosted.

    For the short term (i.e. the next week), I would go with the minimal approach A. Lets get the API docs published. Then the first week of April, we do a design session and figure out what our ideal docs strategy should be. wdyt?

  4. changed the title [-]docs: decide on generated API docs commit strategy (build-time vs publish-time)[/-] [+]docs: implement publishing pipeline[/+] on Mar 12, 2026
  5. planetf1 commented on Mar 12, 2026

    @planetf1
    ContributorAuthor

    There are complications with A (triggering CI, permissions) easily avoided I think by B. Therefore I propose to try that first as it's less work (I know the original post suggested more, but I've had time to think)

    Once we get the other PRs merged I'll start this

  6. planetf1 commented on Mar 12, 2026

    @planetf1
    ContributorAuthor

    Architecture Update: Mintlify Docs Publishing Strategy

    To clear up some confusion regarding our documentation deployment, here is the technical rationale for using isolated deployment branches.

    The Challenge: Mintlify requires a Git branch to sync .mdx files from. Our documentation combines two distinct sources:

    1. Generated API docs built from our Python source (see PR docs: Docs/api pipeline improvements #611).
    2. Handwritten MDX guides (see PR docs: complete developer documentation rewrite (#480) #601).

    The Solution: We will use GitHub Actions to compile both sources into a single directory tree and push the finalized output to dedicated, automated orphan branches. The workflow triggers will be:

    • Merges to main: Triggers a build that pushes the output to docs/staging.
    • New Releases (tag matching a pattern): Triggers a build that pushes the output to docs/production.
      (Note: These specific branch names are placeholders and subject to change).

    We have existing scripts handling parts of this process, which will be consolidated into a single, unified workflow. Mintlify will then be configured to sync exclusively from these deployment branches.

    Why this is the best approach (Pros):

    • Keeps main Clean: Committing generated artifacts directly to main pollutes our Git history with automated commits every time a Python docstring changes.
    • Standard Pattern: This mirrors the established gh-pages deployment model used to bridge source code and Git-based hosting.
    • Security & Scoping: Mintlify only needs access to the isolated docs branches, rather than our entire core codebase.

    Trade-offs & Mitigations (Cons):

    • Risk of Manual Edits: Developers might accidentally check out the generated branches and manually edit .mdx files, which the next pipeline run would instantly overwrite.
    • Optional Mitigations:
      • Make the deployment branches true orphan branches (no shared commit history).
      • Apply strict branch protection rules so only the GitHub Actions service account can push to them.
      • Auto-generate a _DO_NOT_EDIT_.md file at the root of these branches, pointing developers back to main as the source of truth.

    Mintlify Configuration

    To connect this architecture to Mintlify, the configuration relies on the structure of our target branches and the Mintlify dashboard settings:

    1. Mintlify Dashboard Settings: Inside the Mintlify project dashboard (under Git Configuration), we will map our environments to the respective branches (e.g., pointing the staging environment to docs/staging and production to docs/production).
    2. The mint.json File: Our GitHub Actions pipeline must ensure that our mint.json file is copied to the root of the target branch during the build step, alongside the compiled .mdx files.

    Because Mintlify operates via a GitHub App integration, it simply listens for webhooks on the branches we specify. Once the GitHub Actions pipeline pushes the combined docs to docs/staging or docs/production, Mintlify will detect the commit and automatically trigger the corresponding environment deployment.

    @nrfulton @jakelorocco @HendrikStrobelt @psschwei

  7. psschwei commented on Mar 12, 2026

    @psschwei
    Contributor

    could we document the docs pipeline in the repo ?

  8. planetf1 commented on Mar 13, 2026

    @planetf1
    ContributorAuthor

    could we document the docs pipeline in the repo ?

    I've added in a draft PR. However it's not really ready for review yet -- I need to get the other PRs merged.
    I've now completed the mandatory ones (for the main docs review I've fixed many, but offloaded some issues to separate issues so we can get the pipeline in place asap)

  9. planetf1 commented on Mar 13, 2026

    @planetf1
    ContributorAuthor

    Opened #645 - we should track making sure that second-pass is done prior to the release.

  10. planetf1 commented on Mar 13, 2026

    @planetf1
    ContributorAuthor

    From PR #611 review — two items deferred to this issue:

    • Enable workflow_dispatch for manual CI runs (psschwei)
    • Consider moving tests into tooling/docs-autogen/test/ subdirectory (psschwei)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions