Skip to content

ci: cache Vite Task output for docs builds#2006

Merged
fengmk2 merged 15 commits into
mainfrom
codex/docs-build-cache
Jul 2, 2026
Merged

ci: cache Vite Task output for docs builds#2006
fengmk2 merged 15 commits into
mainfrom
codex/docs-build-cache

Conversation

@wan9chi

@wan9chi wan9chi commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Keep the root docs:build script as pnpm -C docs build.
  • Move the cacheable docs build inside docs/: docs now runs installer asset copying first, then delegates vitepress build to the cacheable Vite Task build:site.
  • Configure build:site in docs/vite.config.ts with automatic input tracking, necessary generated-file exclusions, and explicit .vitepress/dist/** output tracking.
  • Add Vite Task cache restore/save steps to deploy-docs.yml and deploy-docs-preview.yml using docs/node_modules/.vite/task-cache.
  • Keep Netlify on pnpm build:netlify, which runs vitepress build directly without vp.
  • Use the released Vite+ package through setup-vp now that the task-cache behavior is available in v0.2.2.

Time Saved

The cache-hit verification run reported 23.14s saved for replaying vitepress build.

  • Cache restored: ~13 MB (13,374,673 B).
  • Restore/download/extract overhead: ~0.41s.
  • Net saving after restore overhead: ~22.73s.
  • Save/upload overhead for the new PR-scoped key: ~0.69s.
  • Net saving including download & upload overhead: ~22.04s.

Cache Verification

Scenario Run Result
Relevant docs task config change Deploy Docs Preview run 28558655161, job 84671537096 Restored the previous PR cache, then vitepress build missed with cache miss: output configuration changed, executing; saved a new PR cache key for 96913ac2.
Irrelevant workflow-only change Deploy Docs Preview run 28559033970, job 84672667814 Restored the PR cache from 96913ac2, then vitepress build hit with cache hit, replaying; saved a new PR cache key for 0bfe9c6e. This verification commit was later dropped from branch history.
Rewritten current PR head Deploy Docs Preview run 28559971286, job 84675438841 Restored the prior PR cache, replayed vitepress build, and saved the current PR-head cache key for 893293ac.

Validation

  • Verified the relevant-change push misses and updates the PR cache.
  • Verified an irrelevant change restores the previous PR cache and hits vitepress build.
  • Verified the post-rewrite PR head still restores the prior PR cache and hits vitepress build.
  • Latest PR checks are green: 12 passed, 16 skipped, 2 neutral, 0 pending, 0 failed.

Notes

The generated input exclusions remain necessary because VitePress reads and writes generated .vitepress and node_modules/.vite-temp files during the cacheable build. Explicit output is included so cached builds restore .vitepress/dist reliably.

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit a8e3267
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a463f0f2726ca00085344b5
😎 Deploy Preview https://deploy-preview-2006--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 837109b to b76ce04 Compare July 1, 2026 10:27
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: a8e3267

@wan9chi wan9chi force-pushed the codex/docs-build-cache branch 5 times, most recently from e7e21a9 to 069097f Compare July 1, 2026 12:17
@wan9chi wan9chi changed the title [codex] Enable cached docs build task ci: cache Vite Task output for docs builds Jul 1, 2026
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 0bfe9c6 to 893293a Compare July 2, 2026 01:55
@wan9chi wan9chi changed the base branch from main to graphite-base/2006 July 2, 2026 02:28
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 893293a to 16f8d05 Compare July 2, 2026 02:29
@wan9chi wan9chi changed the base branch from graphite-base/2006 to skip-docs-deploy-workflows-ci July 2, 2026 02:29

wan9chi commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@wan9chi wan9chi force-pushed the skip-docs-deploy-workflows-ci branch from 6792ba6 to a0e4b7a Compare July 2, 2026 02:30
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 16f8d05 to 1fb0952 Compare July 2, 2026 02:30
@wan9chi wan9chi marked this pull request as ready for review July 2, 2026 02:32
@wan9chi wan9chi marked this pull request as draft July 2, 2026 02:32
@wan9chi wan9chi requested a review from fengmk2 July 2, 2026 02:33
@wan9chi wan9chi marked this pull request as ready for review July 2, 2026 02:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fb09521a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/deploy-docs.yml Outdated
Comment thread docs/vite.config.ts
Base automatically changed from skip-docs-deploy-workflows-ci to main July 2, 2026 03:19
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 1fb0952 to 7ac4c51 Compare July 2, 2026 03:23
Comment thread .github/workflows/deploy-docs-preview.yml Outdated
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 7ac4c51 to 8013cb0 Compare July 2, 2026 06:09
@wan9chi wan9chi force-pushed the codex/docs-build-cache branch from 43ced42 to a8e3267 Compare July 2, 2026 10:35
@fengmk2 fengmk2 merged commit 7575a95 into main Jul 2, 2026
30 checks passed
@fengmk2 fengmk2 deleted the codex/docs-build-cache branch July 2, 2026 11:52
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.

2 participants