Skip to content

Commit 6c108fb

Browse files
ci(docker): Fix caching (#2391)
Because we are building two different Docker containers (one for each platform), we need separate caches for each one, otherwise both builds use the same cache, resulting in them overwriting each other. By setting a [separate scope for each,](https://docs.docker.com/build/cache/backends/gha/#scope) the caches will be separate and not overwrite each other.
1 parent 7954b97 commit 6c108fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ jobs:
296296
push: true
297297
platforms: linux/${{ matrix.platform }}
298298
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.platform }}
299-
cache-from: type=gha
300-
cache-to: type=gha,mode=max
299+
cache-from: type=gha,scope=${{ matrix.platform }}
300+
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
301301

302302
multiarch-docker:
303303
name: Create Multi-Architecture Docker Image

0 commit comments

Comments
 (0)