action-docker-layer-caching
action-docker-layer-caching copied to clipboard
Upgrade actions/cache to v2.
Caching using actions/cache v1.x limits cacheable events to push and pull_request as described here:
https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
Using actions/cache v2.x will allow cacheable workflows on any event that has a GITHUB_REF.
At the moment, I can't have a cacheable workflow started by a release event. Making this change would facilitate this workflow.
This is a bit confusing; this action doesn't use actions/cache (an action), instead it uses @actions/cache (a package on npm).
The actions/cache@v2 action uses the package @actions/[email protected] internally. That's the latest version, and it's the same version being used by this action.
That means this action should already work fine in workflows triggered by any event with a GITHUB_REF. Do you have a workflow run log* where it failed in such a case?
* preferably with ACTIONS_STEP_DEBUG enabled
Oh interesting. Sorry for the misunderstanding there. I'll try to get the debug output. In the meantime, the behavior I am seeing is that:
- If the action is triggered by
on: push, then caching works fine. - If, on the other hand, it is triggered by
on:
release:
types: [created]
Then the step fails with:
Run satackey/[email protected]
with:
key: feed-cache-{hash}
restore-keys: feed-cache-
concurrency: 4
skip-save: false
env:
***
Root cache could not be found. aborting.
Oh interesting. Sorry for the misunderstanding there. I'll try to get the debug output. In the meantime, the behavior I am seeing is that:
- If the action is triggered by
on: push, then caching works fine.- If, on the other hand, it is triggered by
on: release: types: [created]Then the step fails with:
Run satackey/[email protected] with: key: feed-cache-{hash} restore-keys: feed-cache- concurrency: 4 skip-save: false env: *** Root cache could not be found. aborting.
Having the same issue here when using with:
`on:
release:
types:
- released
- prereleased`
Having the same issue here when using with:
`on: release: types: - released - prereleased`
Can you share workflow run logs? As well as the on: release run log it would be good to see the log for the run creating the cache you expected it to use.
For both logs it would help a lot if they had ACTIONS_STEP_DEBUG enabled.
Triggering through tags is also uncached:
on:
push:
tags:
- v*
Apparently the problem was that on each run I had a different env var. When I reran the job the cache was fetched