Commit 64055e7
authored
Replaced node_modules caching with pnpm store caching in CI (TryGhost#27386)
no ref
Replaced the old `node_modules` caching strategy with pnpm's built-in
content-addressable store caching via `actions/setup-node`'s `cache:
pnpm`. Every CI job now runs a clean `pnpm install --frozen-lockfile`
against the cached store, producing a deterministic symlink tree from
scratch.
### Why sqlite3 needs `--force`
sqlite3 is an `optionalDependency` in `ghost/core/package.json`. Without
`--force`, pnpm may skip installing/linking it when restoring from a
cached store. `--force` ensures all optional dependencies are installed
regardless. This only applies to the 2 sqlite3 matrix jobs.
### Benefits
- **Deterministic installs** — every job gets a clean `node_modules`
from `pnpm install`, no symlink ambiguity
- **Better cache hit rate** — cache key is based on lockfile hash (not
lockfile + commit SHA), so cache hits across commits that don't change
dependencies
- **Simpler CI config** — removed custom restore-cache action,
install-deps.sh retry wrapper, cross-job dependency cache key passing,
and the "sleep 10 and retry" cache restore hack
- **Independent jobs** — jobs no longer depend on `job_setup` for a
shared cache key; each caches independently1 parent 6aaa18f commit 64055e7
4 files changed
Lines changed: 70 additions & 191 deletions
This file was deleted.
This file was deleted.
0 commit comments