Skip to content

Publish the API reference to GitHub Pages - #220

Merged
ssavutu merged 3 commits into
mainfrom
feat/api-docs-pages
Aug 23, 2026
Merged

Publish the API reference to GitHub Pages#220
ssavutu merged 3 commits into
mainfrom
feat/api-docs-pages

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 23, 2026

Copy link
Copy Markdown
Member

The Swagger docs are currently only reachable by running the server locally or by being inside the VPN to hit the deployment's /swagger/. This publishes the already-committed spec as a static Swagger UI site at https://drexeltriangle.github.io/triangle-cms/.

What's here

  • .github/workflows/pages.yml — on pushes to main touching the spec, the page, or itself, assembles server/docs/swagger.json plus a vendored, version-pinned swagger-ui-dist into a site and deploys it.
  • docs/api/index.html — the Swagger UI shell. Assets load from alongside it, so the published page hits no third-party CDN at runtime.
  • README notes in the root README and .github/workflows/README.md.

Deliberate choices

It renders the committed spec rather than regenerating it. That keeps the page matching the surface the deployed binary embeds and serves. The tradeoff: nothing in CI verifies the committed spec is current, so annotations changed without a follow-up swag init go stale silently. Happy to add a regenerate-and-diff CI check as a follow-up if that's wanted.

"Try it out" and Authorize are hidden. The spec's @host is localhost:8080, so submitting would fire requests at the reader's own machine. Per-operation padlocks stay, so it's still visible which endpoints need a token. If this should be a live client instead, the fix is pointing @host at the real hostname — but cms.thetriangle.org isn't live yet (deploy/nginx/triangle-cms.conf still has server_name _), so there's nothing correct to put there today.

The workflow sits outside the CI → Publish → Deploy chain. No packages permission, no slot, never on the self-hosted runner.

Note

The repo is already public, so the spec isn't newly exposed — but this does give the full API surface a crawlable URL.

Testing

Assembled the site locally with the workflow's exact steps, served it, and rendered it headless: all 54 paths render grouped by tag, with no submit controls.

🤖 Generated with Claude Code

ssavutu and others added 3 commits August 18, 2026 15:20
The Swagger docs were only reachable by running the server locally or by
being inside the VPN to hit the deployment's /swagger/. Publish the spec
that is already committed as a static Swagger UI site instead, so the API
reference is readable from a URL.

It renders server/docs/swagger.json verbatim rather than regenerating it,
so the page always matches the surface the deployed binary embeds and
serves. Swagger UI's own assets are vendored into the artifact at build
time from a pinned swagger-ui-dist, so the published page loads nothing
from a third-party CDN at runtime.

Try it out and Authorize are hidden: the spec's host is the local dev
server, so submitting would fire requests at the reader's own machine.
The per-operation padlocks stay, so it is still visible which endpoints
need a token.

The workflow is deliberately outside the CI -> Publish -> Deploy chain.
It holds no packages permission, touches no slot, and never runs on the
self-hosted runner.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Docker build regenerates the spec from the handler annotations, so
the deployed binary always serves a current one. But server/docs is also
committed, and the Pages site publishes that committed copy -- nothing
forced the two to agree, so annotations could change without a follow-up
swag init and the published reference would drift from the real API with
no signal.

Regenerating with the pinned version proves the gap was already real:
models.TaxonomyDetail.subsections, added with the A&E subsection strip,
was missing from the committed spec. Commit the regenerated output along
with the check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit f638464 into main Aug 23, 2026
7 checks passed
@ssavutu
ssavutu deleted the feat/api-docs-pages branch August 23, 2026 05:50
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