A GitHub Action that keeps folders between your jobs on Checklane. Each folder sits on a disk that is mounted in place when the job starts, so there is nothing to download, upload or unpack, however big it gets.
Put the disk step before the step that fills the directory. The next job in your repository that uses the same key starts with what the last trusted run left there.
jobs:
build:
runs-on: checklane-4vcpu
steps:
- uses: actions/checkout@v5
- uses: checklane/disk@v1
with:
key: go-build
path: ~/.cache/go-build
- run: go build ./...A new key starts with an empty disk. Your build fills it as usual.
With actions/cache, your job downloads and unpacks a saved cache, then uploads a cache
when it needs to save one. With a disk, the directory is just there, mounted at the path
your tools already use. There is nothing to download, upload or unpack. Even a big
cache has no transfer or unpacking cost when your job restores it.
Disk storage is billed separately. See Limits for pricing and retention.
- The action's main step asks the Checklane machine for your repository's disk named
by
key. - The machine mounts the disk at
path. Your later steps read and write that directory as usual. - After your job's steps, the action's post step asks the machine to unmount the disk. The machine also unmounts every disk when the job ends.
- If the run is trusted and the job succeeded, Checklane keeps what the disk holds for the next job in the repository that uses the same key.
A trusted run is a push, scheduled or manual run on the repository's default branch. Other branches and pull requests can use the disk, but their changes are thrown away.
key and path are required.
-
key: Names the disk within your repository. Up to 128 characters, on one line. Jobs that use the same key get the same disk. -
path: The directory where the disk is mounted. Use an absolute path,~for the runner's home, or a path relative to the workspace. To keep several directories on one disk, list up to 16 of them, one per line. -
commit: When the job's changes to the disk are kept for later jobs. Changes are only ever kept from a successful trusted run (see How it works).true(default): always keep them.false: never keep them. The job reads the disk, and its changes are thrown away. Use it for jobs that share a key with the job that fills the disk, so they don't replace what it left.on-change: keep them only when the job wrote to the disk.if-missing: keep them only when the disk started empty, so the first job fills it and later jobs only read it.
The directory is created if it does not exist. Anything already at path is hidden
while the disk is mounted. Mount the disk before installing dependencies or building.
Use disks for dependencies and build caches your tools can rebuild. Directories that belong together, like a tool's cache and its downloads, can share one disk and one step. You can mount up to 4 disks in one job, each with as many as 16 directories.
These snippets go under steps: in a job running on Checklane, after checkout and any
steps that set up your tools. Use the snippets that fit your project.
Mount both directories before running Go. They share one disk.
- uses: checklane/disk@v1
with:
key: go
path: |
~/.cache/go-build
~/go/pkg/mod
- run: go build ./...Keep the local build cache between jobs. This example uses pnpm to run Turbo.
- uses: checklane/disk@v1
with:
key: turbo
path: .turbo
- run: pnpm install --frozen-lockfile
- run: pnpm exec turbo run buildMount the build cache before building your app. For an app in a subdirectory, adjust
path to point to that app's .next/cache directory.
- uses: checklane/disk@v1
with:
key: next-build
path: .next/cache
- run: pnpm install --frozen-lockfile
- run: pnpm exec next buildKeep compiled build outputs in target.
- uses: checklane/disk@v1
with:
key: rust-target
path: target
- run: cargo build --lockedKeep Gradle's caches between jobs. The build command below also enables Gradle's build cache.
- uses: checklane/disk@v1
with:
key: gradle
path: ~/.gradle/caches
- run: ./gradlew build --build-cachePoint pnpm at the mounted store when installing dependencies.
- uses: checklane/disk@v1
with:
key: pnpm-store
path: ~/.local/share/pnpm/store
- run: pnpm install --frozen-lockfile --store-dir ~/.local/share/pnpm/store- 4 disks per job. A fifth
checklane/diskstep in the same job does nothing and says so. One disk can hold up to 16 directories. - Only trusted runs are kept. The job must succeed in a push, scheduled or manual run on the repository's default branch. Other branches and pull requests, including those from forks, still get the disk, but their changes are thrown away.
- The last job to finish wins. When jobs with the same key run at the same time, the next job starts from the one that finished last.
- $0.30 per GB a month for what the disks hold, paid from your credit first. Disks need a paid plan or credit.
- Each repository has a limit. When it is exceeded, the longest-unused disk is removed first.
- Not in container jobs. A job with
container:runs its steps in the container, where the disk cannot be mounted.
Open the Caching page of your Checklane dashboard to see every disk a repository has, what it holds and what it costs.
On other runners, the action prints a warning and does nothing. Your workflow keeps running without the disk.
If a disk cannot be mounted on Checklane, the action also warns and your job runs without it. If unmounting fails, it warns and the machine unmounts the disk at the end of the job. The action never fails your job.
Pull request jobs get the disk, including jobs for pull requests from forks. Their changes are thrown away, so they do not replace the disk kept for later jobs. Jobs on other branches behave the same way.
The last job to finish wins. To have one job fill the disk and the others only read
it, give the others commit: false. Among jobs whose changes are kept, the next job starts
with what the last finisher left. Changes from pull requests and other untrusted runs
are still thrown away.
Its disk changes are not kept. Only successful jobs in trusted runs update the disk for later jobs.
Use a new key, such as go-build-v2. A new key starts with an empty disk.
No. Your tools write directly to the mounted directory. The action's post step handles unmounting, and Checklane keeps the disk when the run qualifies.
See AGENTS.md for how the action works, local commands and contribution rules.