This action extends actions/cache with local filesystem cache support for self-hosted runners using PVC/NFS storage.
- 🎉 Local cache support for self-hosted runners with PVC/NFS storage
- Simple activation via
local-cache-pathparameter - Fully backward compatible with the original
actions/cache - Optimized for network filesystems using tar.gz compression
When local-cache-path is not specified, this action works exactly like the original actions/cache, using GitHub's remote cache service.
Use local filesystem cache instead of GitHub's remote cache service:
- uses: self-hosted-actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
local-cache-path: /mnt/cache # Path to PVC/NFS mountWithout local-cache-path, works exactly like actions/cache:
- uses: self-hosted-actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}All inputs from actions/cache are supported, plus:
local-cache-path- Local directory path for caching. When set, uses local filesystem cache instead of remote cache. Optional
Same as actions/cache:
cache-hit- A boolean value to indicate an exact match was found for the key
When local-cache-path is specified:
- Cache files are stored as
{local-cache-path}/{key}.tar.gz - Uses tar.gz compression for network filesystem efficiency
- Supports exact key matching and prefix-based restore keys
- No data sent to GitHub's cache service
When local-cache-path is not specified:
- Works exactly like the original
actions/cache - Uses GitHub's cache service
- See actions/cache documentation for details
For all other features, configurations, and best practices, refer to the original actions/cache documentation:
The scripts and documentation in this project are released under the MIT License