Docker layer cache (`type=gha`) never hits on PR builds.
AdvancedTroubleshootingCaching, Artifacts, Builds & Scans
Answer
Likely causes → Cache only written from PR refs (invisible to other PRs), cache evicted due to the 10 GB quota, scope differs between writers and readers, or the build context changes early layers each time (copying source before installing dependencies).
Diagnose → gh cache list --key buildkit and build logs showing CACHED vs rebuilt layers.
Fix → Write cache from main, keep scopes consistent, reorder Dockerfile, consider registry cache.
Prevent → Monitor cache size and hit rates.
More on Caching, Artifacts, Builds & Scans
`Cache not found for input keys: npm-Linux-3f9a...` on every single run.Beginner`Failed to save: Unable to reserve cache with key npm-Linux-3f9a..., another job may be creating this cache.`BeginnerA cache restores but the build is still slow and reinstalls everything.Intermediate`Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run`Beginner`Error: Unable to download artifact(s): Artifact not found for name: build`Beginner`Warning: No files were found with the provided path: coverage/. No artifacts will be uploaded.` but tests ran.Beginner