Cache once. Reuse everywhere.
This repository demonstrates all BoringCache GitHub Actions with real-world examples.
| Action | Description | Example |
|---|---|---|
| boringcache/action | Drop-in replacement for actions/cache |
ci.yml |
| boringcache/save | Save cache artifacts | save-restore.yml |
| boringcache/restore | Restore cache artifacts | save-restore.yml |
| boringcache/setup-boringcache | Install BoringCache CLI | setup-cli.yml |
| boringcache/nodejs-action | Node.js + npm/yarn/pnpm caching | nodejs.yml |
| boringcache/ruby-action | Ruby + Bundler caching | ruby.yml |
| boringcache/rust-action | Rust + Cargo caching | rust.yml |
| boringcache/docker-action | Docker BuildKit layer caching | docker.yml |
| boringcache/buildkit-action | BuildKit daemon caching | buildkit.yml |
- Get your API token from boringcache.com
- Add
BORINGCACHE_API_TOKENto your repository secrets - Copy any workflow from this repo and adapt to your needs
Replace actions/cache with boringcache/action:
- uses: boringcache/action@v1
with:
path: node_modules
key: deps-${{ hashFiles('package-lock.json') }}
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}Use workspace format for multi-project caching:
- uses: boringcache/action@v1
with:
workspace: my-org/my-project
entries: deps:node_modules,build:.next
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}Separate restore and save steps:
- uses: boringcache/restore@v1
with:
workspace: my-org/my-project
entries: deps:node_modules
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}
- run: npm ci
- uses: boringcache/save@v1
with:
workspace: my-org/my-project
entries: deps:node_modules
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}Use language actions for automatic setup + caching:
# Node.js
- uses: boringcache/nodejs-action@v1
with:
node-version: '20'
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}
# Ruby
- uses: boringcache/ruby-action@v1
with:
ruby-version: '3.3'
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}
# Rust
- uses: boringcache/rust-action@v1
with:
toolchain: stable
env:
BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}- Portable caches - reuse in CI, Docker, and local dev
- Content-addressed - skip uploads for unchanged content
- Cross-platform - Linux, macOS, Windows
- Unified caching - same cache works everywhere
MIT