self-host →

Cache multiple folders with a sticky disk

Persist several package and build caches on one native-speed EBS disk.

A sticky disk is one persistent EBS disk per job. runs-on/action@v2 can mount many cache directories onto it, so each tool keeps its normal path while all of the data persists together between jobs.

Editorial update (August 2026): RunsOn Team rewrote this tip for v3.2. It supersedes the original community snapshot workaround by JulesClaussen.

jobs:
build:
runs-on: runs-on=${{ github.run_id }}/runner=2cpu-linux-x64/sticky=build-cache:30gb
steps:
- uses: actions/checkout@v7
- uses: runs-on/action@v2
with:
sticky_cache: |
go
pnpm
custom,path=.turbo,path=vendor/cache
- run: go test ./...

Each non-empty sticky_cache line is a cache record. RunsOn knows common paths such as go and pnpm. Use custom,path=... for anything else, and repeat path= when one cache record needs several directories. Relative paths resolve from the workspace, so put the action after checkout for workspace caches.

There is no need to change a tool’s cache directory, move Docker’s data root, or pack unrelated folders into one snapshot path. The action binds the requested directories to the same disk and snapshots it only after a clean unmount.

For BuildKit layers or Git checkout mirrors, use their dedicated buildkit and git modes; both have ordering requirements. See the complete sticky-disk guide for supported modes, lifecycle, and Fleet setup.