Skip to content
This repository was archived by the owner on Oct 4, 2026. It is now read-only.

fix(docs): derive GitHub Pages base path from the building repository - #395

Merged
lstein merged 1 commit into
mainfrom
fix/docs-ghpages-base
Oct 2, 2026
Merged

lstein merged 1 commit into
mainfrom
fix/docs-ghpages-base

Conversation

@lstein

@lstein lstein commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The docs deployed from this repo to https://invoke-ai.github.io/InvokeAI-7/ have no styles and broken links. Push builds always used the custom target (invoke.ai, base ''), so every asset and link was root-relative (/_astro/…) and resolved outside /InvokeAI-7/. The manual ghpages option didn't help either: it hardcoded /InvokeAI.

  • New docs/src/lib/deploy-target.mjs resolves the target. A ghpages build takes its site and base from GITHUB_REPOSITORY (https://<owner>.github.io + /<repo>) and falls back to /InvokeAI outside Actions. astro.config.mjs and verify-deploy-output.mjs both use it, so the build and the check stay in sync.
  • deploy-docs.yml picks the target per repository. invoke-ai/InvokeAI builds custom; any other repo (this one, forks) builds ghpages. workflow_dispatch gets a new default, auto, and custom/ghpages still override it. The target is set once in the job env and shared by the build and verify steps.
  • Analytics are enabled only for custom builds on main. This repo's broken deploy had been reporting page views to invoke.ai's Plausible account.

Edit links, the GitHub social link and the changelogs source still point to invoke-ai/InvokeAI on purpose: edits should go upstream.

QA Instructions

From docs/:

  • pnpm test: 19/19 pass, including the new deploy-target.test.mjs.
  • DEPLOY_TARGET=ghpages GITHUB_REPOSITORY=invoke-ai/InvokeAI-7 pnpm build && pnpm run check-deploy-output passes. Assets are at /InvokeAI-7/_astro/… and the canonical URL is https://invoke-ai.github.io/InvokeAI-7/. Pagefind, the sitemap, llms.txt, font URLs and redirect pages all carry the /InvokeAI-7 base.
  • DEPLOY_TARGET=custom … pnpm build && pnpm run check-deploy-output passes, and the output is unchanged (canonical https://invoke.ai/).
  • A negative check, running the ghpages dist through the verifier as custom, fails with 13 errors.

The live deploy can only be checked after merge, because Pages deploys run only from main.

Review

No material findings. Known limits that are not regressions:

  • public/CNAME (invoke.ai) still ships in this repo's artifact. Actions-based Pages deploys ignore it.
  • A repo named <owner>.github.io would get a /<owner>.github.io base. No such repo exists.

Compatibility / Rollout

Upstream invoke-ai/InvokeAI keeps building custom exactly as before. In this repo, the next docs-related push to main (merging this PR counts) deploys the corrected site.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

🤖 Generated with Claude Code

Copies and forks of the repo built for invoke.ai, so assets and links broke under /<repo>/.
Only invoke-ai/InvokeAI now builds the custom target; others build ghpages with site and base
taken from GITHUB_REPOSITORY, shared by the Astro config and the deploy-output check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lstein
lstein requested a review from blessedcoolant as a code owner October 2, 2026 01:05
@lstein
lstein merged commit da1ca14 into main Oct 2, 2026
14 checks passed
@lstein
lstein deleted the fix/docs-ghpages-base branch October 2, 2026 01:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant