Skip to content

Commit b30e901

Browse files
ci: switch Docker GHA cache to mode=min to reduce cache bloat (#1152)
## Problem The main branch Docker build workflow was using `cache-to: type=gha,mode=max`, which saves all intermediate build layers (50+ stages). Combined with recent workflow changes, this caused the repo GHA cache to balloon to ~10 GB, hitting GitHub's per-repo limit and triggering eviction of the `essentialcsharpweb-main` scope layers. Result: subsequent builds saw 0% cache hit despite warm cache. ## Solution Switch to `cache-to: type=gha,mode=min` on the main branch deploy workflow. - `mode=min` saves only the final exported layers (base image + published app binaries) - `cache-from` still reads everything available, so builds benefit from layer reuse on unchanged stages - Expected cache footprint reduction: ~60% (6.7 GB → ~2.5 GB) - No impact on cache hit rates for stable/slow-changing layers ## Changes - `.github/workflows/Build-Test-And-Deploy.yml`: line 95, change `mode=max` to `mode=min` This is a safe, read-path-agnostic change — pulling behavior is unaffected, only what gets written changes.
1 parent a62a63b commit b30e901

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/PR-Build-And-Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@ jobs:
109109
cache-from: |
110110
type=gha,scope=essentialcsharpweb-main
111111
type=gha,scope=essentialcsharpweb-pr
112-
cache-to: type=gha,mode=max,scope=essentialcsharpweb-pr
112+
cache-to: type=gha,mode=min,scope=essentialcsharpweb-pr
113113
build-args: ACCESS_TO_NUGET_FEED=false

0 commit comments

Comments
 (0)