Skip to content

chore: add CI/CD workflows, internal link checker, and project docs - #7

Merged
BK5102 merged 5 commits into
chore/site-cleanupfrom
chore/add-ci-cd
Oct 2, 2026
Merged

BK5102 merged 5 commits into
chore/site-cleanupfrom
chore/add-ci-cd

Conversation

@BK5102

@BK5102 BK5102 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #6 (which is stacked on #5). Merge #5, then #6, then this one.

What changed and why

CI on every PR (.github/workflows/ci.yml)

  • Runs npm ci, npm run lint, npm run check-links, and npm run build on every pull request.
  • On push to main (a merged PR), it re-runs the checks, then deploys dist/ to the gh-pages branch with the same gh-pages tool as npm run deploy. GitHub's pages-build-deployment workflow then publishes it. npm run deploy remains available as a manual fallback.

Internal link checker (scripts/check-links.mjs, npm run check-links)

It fails the build if any of the dead-link bugs from #5 come back:

  • A plain <a href="/path"> pointing at an app route, which bypasses HashRouter.
  • A ?guide=<slug> that doesn't exist or is hidden.
  • An in-guide #anchor with no matching section.
  • public/<name>/index.html redirect pages that drift from src/data/links.js.
  • A headshot filename in leaders.json that's missing from src/assets/Headshots/.

External link check (.github/workflows/links.yml)

  • Runs weekly and on demand with lychee. It does not run on PRs, so a third-party site going down can't block a merge.
  • Accepts LinkedIn's bot-block code (999), and excludes the sites that block bots (Handshake, Glassdoor, Investopedia). Those still need checking by hand.

Tooling and docs

  • Pin Node 22 (.nvmrc) and engines: >=20.19 (the minimum for Vite 7).
  • CONTRIBUTING.md: deploys are now automatic on merge; documents the new checks.

How it was tested

  • Lint, check-links, and build all pass locally on this branch.
  • Planted the original bugs in a temporary file (a plain href, a nonexistent guide slug, a drifted Discord redirect). check-links reported all of them and correctly allowed /discord.
  • The workflows themselves can only run on GitHub. This PR's own CI run is the first test of ci.yml.

After merging

  • Confirm the CI deploy job on main and the pages-build-deployment workflow both succeed, then check devilquant.com.
  • Recommended: in Settings → Branches, protect main and require the CI / verify check, so failing PRs can't be merged.
  • links.yml can be triggered once by hand from the Actions tab to see the baseline.

Claude Code notes (CLAUDE.md, PROMPT.md) were removed from the repo on 2026-10-02 and are kept local only; both names are gitignored.

- .github/workflows/ci.yml: on every PR, run lint, check-links, and build;
  on push to main, re-run checks and deploy dist/ to gh-pages.
- .github/workflows/links.yml: weekly/manual external link check (lychee).
- scripts/check-links.mjs (npm run check-links): fail on plain hrefs to app
  routes, missing/hidden guide slugs, broken in-guide anchors, public/
  redirect pages drifting from src/data/links.js, missing headshot files.
- Pin Node 22 (.nvmrc) and engines >=20.19 (Vite 7 minimum).
- CONTRIBUTING.md: document automatic deploys and the new checks.
- CLAUDE.md: update architecture notes; import PROMPT.md.
- PROMPT.md: working brief with goals, constraints, and audit status.
BK5102 added 3 commits October 1, 2026 06:12
PR checks on #7/#8 showed cancelled "verify" runs and a "deploy" job
marked with "!", which read as CI not running. CI did run and pass: pushing
the stacked branches together fired two pull_request runs per PR, and the
concurrency group (cancel-in-progress on PRs) cancelled the older one. The
deploy job always appeared on PRs as skipped.

- ci.yml: verify only; no concurrency group (runs take ~20s), so duplicate
  runs both complete instead of posting cancelled checks.
- deploy.yml: new; runs via workflow_run after CI passes on a push to main
  (or manually) and publishes the verified commit to gh-pages.
- actions/checkout and actions/setup-node v4 -> v6 (Node 24), in ci.yml,
  deploy.yml, and links.yml, clearing the Node 20 deprecation warnings.
- CONTRIBUTING.md and CLAUDE.md describe the new Deploy workflow.
- ci.yml: new `performance` job runs Lighthouse CI (mobile preset, 3 runs,
  median) on Home and About, fails on budget violations, writes a results
  table to the run summary, and uploads the reports.
- lighthouserc.cjs: budgets for the current pages (score >= 60, LCP <= 3.5s,
  TBT <= 2.5s, CLS <= 0.1, weight <= 1 MB). A ?page= query keeps hash routes
  separate, since LHCI groups URLs without the #hash.
- npm run perf: same check locally; scripts/perf-summary.mjs prints medians.
- CONTRIBUTING.md / CLAUDE.md: run `npm run perf` before every commit/PR and
  report the numbers.

Measured on this branch (local, Edge, mobile preset, median of 3):
  Home  score 94, LCP 2.49s, TBT 0ms,   CLS 0.001, 177 KB
  About score 77, LCP 2.70s, TBT 648ms, CLS 0.014, 384 KB
BK5102 added a commit that referenced this pull request Oct 1, 2026
…oad Lexend

Merges the Lighthouse CI performance job from #7, then ratchets the budgets
to the redesigned site and fixes the one budget it missed:

- vite.config.js: preload the hashed Latin Lexend woff2 so text paints in its
  final face sooner (About's LCP element is a text block that waited on the
  font). FCP 1.93s -> 1.65s, About LCP 2.73s -> 2.56s, Home LCP 2.22s -> 2.13s.
- lighthouserc.cjs: score >= 85, LCP <= 3.0s, TBT <= 400ms, CLS <= 0.05,
  weight <= 600 KB (from 60 / 3.5s / 2.5s / 0.1 / 1 MB on #7).

Measured (local, Edge, mobile preset, median of 3):
  Home  score 98, FCP 1.65s, LCP 2.13s, TBT 82ms,  CLS 0, 197 KB
  About score 96, FCP 1.63s, LCP 2.56s, TBT 100ms, CLS 0, 388 KB
@BK5102

BK5102 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Performance results

Lighthouse, mobile preset (simulated slow 4G, 4x CPU), median of 3 runs, local Edge build served with gzip. Compared with main built the same way.

Build Page Score FCP LCP TBT CLS Weight
main Home 94 2.50 s 2.50 s 0 ms 0.001 3,377 KB
main About 67 2.49 s 2.72 s 2,212 ms 0.014 2,202 KB
#7 Home 94 2.50 s 2.50 s 0 ms 0.001 176 KB
#7 About 77 2.48 s 2.70 s 648 ms 0.014 384 KB

CI (GitHub runner, new performance job): Home 98 (LCP 1.81 s, TBT 0 ms, 176 KB), About 93 (LCP 1.81 s, TBT 43 ms, 383 KB), all budgets passing.

Verdict: no runtime change (CI/docs only). This PR adds the Lighthouse CI performance gate (performance job, lighthouserc.cjs, npm run perf) that runs on every PR and push to main, fails on budget violations, and posts a results table on the run summary. Budgets here: score >= 60, LCP <= 3.5 s, TBT <= 2.5 s, CLS <= 0.1, weight <= 1 MB. #8 tightens them.

The maintainer keeps Claude Code guidance and the working brief in local,
untracked files outside the repo. Ignore both names so they aren't
recommitted. No runtime change.
@AlexanderPach
AlexanderPach self-requested a review October 2, 2026 07:53
@BK5102
BK5102 merged commit f955637 into chore/site-cleanup Oct 2, 2026
2 checks passed
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