I'm trying to cache the result of docker save, which creates a tar file.
When I try to cache a single file, an error is raised.
- name: Cache docker layers
uses: actions/cache@preview
id: cache
with:
path: docker_cache.tar
key: ${{ runner.os }}-docker
/bin/tar -cz -f /home/runner/work/_temp/9d43813f-9c7b-4799-ac7d-f8d0749e7d8c/cache.tgz -C /home/runner/work/<repo>/<repo>/docker_cache.tar .
3
/bin/tar: /home/runner/work/<repo>/<repo>/docker_cache.tar: Cannot open: Not a directory
4
/bin/tar: Error is not recoverable: exiting now
5
##[warning]The process '/bin/tar' failed with exit code 2
I could create a directory just to hold the tar file, but it would be nice if this actions supports caching single files.
There seems to be a bug related to this: https://github.com/actions/cache/issues/144
:wave: With the changes to support glob patterns and multiple paths (https://github.com/actions/cache/pull/212), single file caches are now supported.
This is currently available in the default branch (-uses: actions/cache@master) and we'll be pushing a v2 tag next week, see #323 for details.
Most helpful comment
:wave: With the changes to support glob patterns and multiple paths (https://github.com/actions/cache/pull/212), single file caches are now supported.
This is currently available in the default branch (
-uses: actions/cache@master) and we'll be pushing av2tag next week, see #323 for details.