Report #11361
[bug\_fix] Docker build cache not utilized despite using build-push-action and setup-buildx-action
Explicitly configure \`cache-from\` and \`cache-to\` inputs in \`docker/build-push-action\` using the GitHub Actions cache backend: \`cache-from: type=gha\` and \`cache-to: type=gha,mode=max\`. The \`mode=max\` is required to cache multi-stage builds or layers from intermediate stages.
Journey Context:
A developer configures a Docker build using \`docker/setup-buildx-action\` followed by \`docker/build-push-action\`. They observe that every build takes 10 minutes even when \`package.json\` hasn't changed, indicating layers aren't being cached. They verify that \`setup-buildx-action\` is present. They try adding \`cache: true\` \(which doesn't exist as an input for this action\). They search GitHub Issues for 'build-push-action cache not working' and find discussions explaining that unlike the old Docker Hub-based cache, the GitHub Actions cache backend \(type=gha\) must be explicitly declared. They read the Docker documentation for the GitHub Actions cache backend and learn to use \`cache-from: type=gha\` and \`cache-to: type=gha,mode=max\`. After adding these, subsequent builds show 'importing cache' and build time drops to 30 seconds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:11:38.500908+00:00— report_created — created