Add the VitePress documentation site and its Pages deploy workflow - #230
Open
juanmaguitar wants to merge 1 commit into
Open
Add the VitePress documentation site and its Pages deploy workflow#230juanmaguitar wants to merge 1 commit into
juanmaguitar wants to merge 1 commit into
Conversation
This was referenced Aug 10, 2026
juanmaguitar
force-pushed
the
docs/site
branch
from
August 10, 2026 09:38
f66bd84 to
133fea3
Compare
The user guide gets a real home. `docs/` becomes a VitePress site with its own npm package, so a docs-only CI job never runs the root postinstall (electron-builder + esbuild) and the app's dependency tree stays free of a static-site generator. `.github/workflows/docs.yml` builds it and deploys to GitHub Pages on every push to trunk that touches it; pull requests get a build-only job, so a dead link fails before merge and the job holding the OIDC token never runs on PR code. The site's base path is derived from the repository name at run time rather than hardcoded, because a project Pages site is served under /<repo-name>/ and this repository was renamed. Deriving it means a rename cannot break every asset URL. `srcExclude` keeps `docs/testing.md` (#70) out of the built site: it documents how to run the suites, which is contributor material, and the published guide is for users of the app. This PR carries the pipeline and the home page only. The sidebar already names the full guide, so its links 404 until the pages land — merge the stack in order rather than leaving this one on trunk on its own.
juanmaguitar
force-pushed
the
docs/site
branch
from
August 10, 2026 12:52
133fea3 to
fd9810e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The app's user documentation is the README, and it has outgrown it: install steps, a ten-step
walkthrough and the trunk-update rules all compete for the same page, and there is nowhere to put
a screenshot. This PR gives the guide a home and a deploy pipeline. It carries no guide content
beyond the landing page — that arrives in #232, and the harness that photographs the app in #231.
What changes
docs/becomes a VitePress site with its own npm package, so a docs-only CI job never runsthe root
postinstall(electron-builder + esbuild) and the app's dependency tree stays free ofa static-site generator.
.github/workflows/docs.ymlbuilds and deploys to GitHub Pages on pushes totrunkthat touchdocs/. Pull requests get a build-only job: a dead link fails before merge, and the jobholding the OIDC token never runs on PR code.
baseis derived from the repository name at run time. A project Pages site is servedunder
/<repo-name>/, and this repo has already been renamed once — deriving it means anotherrename cannot break every asset URL.
srcExcludekeepsdocs/testing.md(from e2e: packaged-app smoke test on macOS and Windows #70) out of the published site: it documents how torun the suites, which is contributor material, and this site is for users of the app.
How to test this
Starting state: this branch checked out,
npm cidone.npm run docs:build— expectbuild complete. Now add a link to a page that does not exist indocs/index.mdand run it again: it must fail withdead link(s) found. Undo.npm run docs:preview, open the printed URL — the home page renders with the WordPressContributor Toolkit hero and the sidebar. Clean URLs work; this is exactly what Pages serves.
npm run docs:dev— pages are served at their.htmlpaths in dev (/index.html). With thedev server open, run
npm run docs:buildin another terminal: the dev server must not spewreload lines (it ignores its own output directory).
npm run lintandnpm test— both green, unchanged fromtrunk.Must not have happened: no
deployjob may run on this pull request — check the Actions taband confirm only
build siteran.Not testable by hand here: the deploy itself. It needs the workflow on
trunk, and Pages isalready set to "GitHub Actions" as its source.
Risks
Merging this alone deploys a site whose sidebar names the full guide, so those links 404 until
the content PR lands. Merge the stack in order rather than leaving this on
trunkby itself.The deploy job holds
pages: writeandid-token: write. Its actions are pinned to commit SHAsrather than tags, following the reasoning already written down in
download-stats.yml.Related
Stack: this → #231 (screenshot harness) → #232 (guide content).
Touches #70 only through
srcExclude; that PR needs no change.Self-review — 5 findings, all fixed
Ran
.github/instructions/code-review.instructions.mdwith the judgement pass in a fresh context.Deterministic layer was clean (ESLint and the unit suite on macOS and Windows).
5 [fix here] · 1 [follow-up]. All five fixed in this branch:
checkoutkept the job'sGITHUB_TOKENin.git/configwhile the job runs PR-authored code (npm ciwith lifecycle scripts, and a VitePress build that evaluatesconfig.mjs)persist-credentials: false, matchinglint.ymlif: github.event_name != 'pull_request'let aworkflow_dispatchon any ref publish to the live site, which is not what the comment claimedif: github.ref == 'refs/heads/trunk'node-version: 22hardcoded while.nvmrcsays 24.18.0 — reintroducing the Node drift of #37/#46 for the one command CONTRIBUTING calls "what CI runs"node-version-file: .nvmrccancel-in-progress: true, so a second push could cancel an in-flightdeploy-pagesdocs:*without saying the nested package needs its own install, so the commands fail on a clean clonenpm ci --prefix docsdocumentedDeferred [follow-up]:
electron-builderhas nofilesfilter, so trackeddocs/sources shipinside
app.asar— and #232 adds screenshots on top. Real, pre-existing, and overlaps #23; an!docs{,/**/*}entry closes it. Not done here because it changes what every release artifactcontains, which deserves its own PR and its own testing.
Checked and clean: all four action pins resolve to the tags their comments claim (verified
against the GitHub API);
pull_request_targetis correctly not used and no fork PR can reachpages: write/id-token: write; the lockfile is 175 packages, all from registry.npmjs.org, withinstall scripts only on esbuild and fsevents; the
import/no-unresolvedexemption is a genuinefalse positive and hides nothing; no
src/code, IPC surface or spawn path is touched.