actions / actions/cache

Cache miss when restoring within a reusable workflow

Open
#1,271 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Greetings!

Our organization uses a reusable workflow to build our docker images. We recently attempted to add caching to this workflow to speed up the build process. While we already use the cache action for our separate CI workflow, we've noticed the build workflow always fails to hit the cache and it's unclear why.

Here's the current reusable build workflow

build.yml

We verified multiple times that Cache exists in the default branch (main)

image

Based on the documentation we should be able to restore this cache in our feature branches, but we're getting cache misses on the restore steps

image

Is there documentation related to this particular scenario or are we missing a key step to make this work? Any help would be appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked build.yml reusable workflow and the cache action documentation for cache restoration in feature branches. Compare the workflow's restore steps with the reported cache-existence and cache-miss screenshots. Done means the cause is documented or the workflow reliably restores the expected cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.