You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: cache Vite Task output for docs builds (#2006)
## 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](https://github.com/voidzero-dev/vite-plus/actions/runs/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](https://github.com/voidzero-dev/vite-plus/actions/runs/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](https://github.com/voidzero-dev/vite-plus/actions/runs/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.
0 commit comments