Skip to content

Add a workflow to deploy docs to GitHub Pages #199

@Imod7

Description

@Imod7

Description

Rel: #190

Add a CI workflow to automatically build and deploy the documentation UI (docs/) to GitHub Pages when changes are pushed to main.

Current Status

The documentation is built with webpack 5 + vanilla JS (located in docs/). It renders the OpenAPI spec (auto-generated via utoipa) into an interactive API reference with endpoint explorer, Send Request, cURL generation, data schemas, guides, and search. Currently it can only be built and viewed locally.

Suggested Solution

Create a new workflow (e.g. .github/workflows/docs.yml) which:

  • runs on pushes to main and PRs targeting main, but only when files in docs/ change

  • it includes the following jobs (using actions/upload-pages-artifact + actions/deploy-pages):

    Job 1 - build-docs:

    1. Checks out the repo
    2. Sets up Node.js 20
    3. Caches and installs npm dependencies in docs/
    4. Runs npm run build (webpack) to produce docs/dist/
    5. On main branch only: uploads docs/dist/ as a GitHub Pages artifact

    Job 2 - deploy-docs:

    • Only runs on main (not PRs)
    • Uses the official actions/deploy-pages action to deploy the built artifact to GitHub Pages

Key difference from the old sidecar deployment process:

  • No separate branch to maintain
  • No GitHub App tokens or force pushes needed
  • No manual git commit / git push to gh-pages in CI
  • Built-in deployment status tracking in GitHub's Environments UI
  • Officially recommended by GitHub for new setups

Prerequisites

  • Set GitHub Pages source to GitHub Actions (Settings > Pages > Source)
  • Ensure openapi.json in docs/ is up to date before merging docs changes (generated via npm run update-spec from a running server)

Checks before making docs public

  • Update the version in the docs (currently showing v0.1.0)
  • Review all documents in docs/guides and check if any are not needed anymore such as docs/guides/remaining-endpoints-overview.md
  • Files pallets-constants.md and pallets-constants.md in guides are internal and are not shown in the docs UI
  • Add a page/link int he docs UI that points to the benchmark page (?)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions