Skip to content

Cache single file #33

@tuler

Description

@tuler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions