GitHub Actions
Caching
One important thing to know about GHA cache keys is that they only apply to the current pull request. Steps in other PRs that use the exact same cache keys and try to restore cached data will result in missed cache. The only way to work around this is to cache in a GH action when pushing to your main branch. This cache acts globally per repository and can be used in all pull requests.
Composer vendor caching
Do not cache the vendor
dir, but only the Composer cache itself. The vendor
directory includes autoloading and other metadata, which is unique per commit.
NPM modules caching
Do not cache the node_modules
dir, but only the NPM cache itself. npm ci
deletes node_modules
before installing it again (from cache), so restoring it is redundant.