Skip to content

fix: remove cacheDir override and node_modules CI caching - #32587

Draft
mvvmm wants to merge 1 commit into
productionfrom
fix/remove-cacheDir-override-and-node-modules-cache
Draft

fix: remove cacheDir override and node_modules CI caching#32587
mvvmm wants to merge 1 commit into
productionfrom
fix/remove-cacheDir-override-and-node-modules-cache

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the cacheDir: ".astro-cache" override from astro.config.ts, reverting to Astro's default node_modules/.astro. This was originally added in #31192 to work around a stale-cache problem caused by CI caching the entire node_modules directory — the dependency-only cache key (pnpm-lock.yaml + package.json hashes) didn't account for content/source changes, so stale Astro content-layer state persisted across runs.

Instead of working around the problem by moving the cache directory, this PR removes the root cause: the direct node_modules caching in all GitHub Actions workflows. All jobs now rely solely on setup-node's cache: pnpm (which caches the pnpm store, not node_modules itself) and run pnpm install --frozen-lockfile unconditionally. The targeted Astro assets cache is kept but updated to use the default path (node_modules/.astro/assets).

This also aligns the repo with Workers Builds' built-in Astro caching, which hardcodes node_modules/.astro as the cache directory.

Files changed:

  • astro.config.ts — removed cacheDir override and .astro-cache from Vite watch ignored paths
  • .gitignore — removed .astro-cache/ entry
  • .github/workflows/ci.yml — removed node_modules cache/restore steps from all 5 jobs; updated Astro assets cache path to node_modules/.astro/assets
  • .github/workflows/publish-production.yml — same
  • .github/workflows/bonk.yml, bigbonk.yml, anchor-link-audit.yml — removed node_modules cache/restore steps

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Remove the cacheDir: ".astro-cache" override from astro.config.ts,
reverting to Astro's default node_modules/.astro. Remove direct
node_modules caching from all GitHub Actions workflows — rely solely
on setup-node's cache: pnpm (pnpm store) instead. This eliminates the
stale content-layer cache problem that originally motivated the
cacheDir override in #31192.

The targeted Astro assets cache is kept but updated to use the
default path (node_modules/.astro/assets).
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