CI Perf Lint

docker-build-without-layer-cache

Detects docker/build-push-action and depot/build-push-action steps that do not configure cache-from and cache-to.

Without layer caching, every CI run rebuilds all Docker layers from scratch, even when the Dockerfile and source files are unchanged. This adds minutes per build for no benefit.

The simplest and most effective cache backend for GitHub Actions is the built-in type=gha, which stores cache in the action’s own cache storage:

- uses: docker/build-push-action@v6
  with:
    context: .
    cache-from: type=gha
    cache-to: type=gha,mode=max

Other supported backends include type=registry, type=s3, type=azblob, and type=local.

Why it matters

What to check