Sets up actions/cache for the bun cache directory (default: ~/.bun/install/cache).
- Caches bun's package cache to speed up installs in subsequent runs.
- Exports
BUN_INSTALL_CACHE_DIRviaGITHUB_ENVso bun uses the same cache path in later steps. - No-op when no
bun.lockorbun.lockbfile is found. - Uses lockfile hash in the cache key for correctness.
Run after checkout; run before any bun install command.
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 📦 Cache bun
uses: w5s/actions/cache-bun@main
with:
cache-path: .bun-cache # optionalcache-path(optional): bun cache directory to store/restore. Defaults to~/.bun/install/cache.
- Use in projects that have
bun.lockorbun.lockb(bun). Bun must be available (e.g. afterci-setup).