Skip to content

This repository demonstrates all BoringCache GitHub Actions with real-world examples.

Notifications You must be signed in to change notification settings

boringcache/actions-demos

Repository files navigation

BoringCache Actions Demos

Cache once. Reuse everywhere.

This repository demonstrates all BoringCache GitHub Actions with real-world examples.

Available Actions

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

Quick Start

  1. Get your API token from boringcache.com
  2. Add BORINGCACHE_API_TOKEN to your repository secrets
  3. Copy any workflow from this repo and adapt to your needs

Usage Patterns

Pattern 1: Drop-in Cache (Simplest)

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 }}

Pattern 2: Workspace Format (Recommended)

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 }}

Pattern 3: Save/Restore (Granular Control)

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 }}

Pattern 4: Language-Specific (Zero Config)

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 }}

Why BoringCache?

  • 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

License

MIT

About

This repository demonstrates all BoringCache GitHub Actions with real-world examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •