Skip to content

Commit 750118c

Browse files
committed
fix: platform error
1 parent 50fc58b commit 750118c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ jobs:
125125
prefix:((opt.input?.etc?.semverprefix) ? `${opt.input?.etc?.semverprefix}-` : ''),
126126
suffix:((opt.input?.etc?.semversuffix) ? `-${opt.input?.etc?.semversuffix}` : ''),
127127
description:(opt.dot?.readme?.description || ''),
128+
platform:{
129+
sanitized:"${{ matrix.platform }}".replace(/[^A-Z-a-z0-9]+/i, ""),
130+
},
128131
tags:[],
129132
},
130133
app:{
@@ -196,7 +199,7 @@ jobs:
196199
197200
// export to environment
198201
core.exportVariable('DOCKER_CACHE_REGISTRY', docker.cache.registry);
199-
core.exportVariable('DOCKER_CACHE_NAME', docker.cache.name);
202+
core.exportVariable('DOCKER_CACHE_NAME', `${docker.cache.name}-${docker.image.platform.sanitized}`);
200203
core.exportVariable('DOCKER_CACHE_GRYPE', docker.cache.grype);
201204
202205
core.exportVariable('DOCKER_IMAGE_NAME', docker.image.name);
@@ -270,8 +273,8 @@ jobs:
270273
file: ${{ env.DOCKER_IMAGE_DOCKERFILE }}
271274
push: true
272275
platforms: linux/${{ matrix.platform }}
273-
cache-from: type=registry,ref=${{ env.DOCKER_CACHE_NAME }}-${{ matrix.platform }}
274-
cache-to: type=registry,ref=${{ env.DOCKER_CACHE_REGISTRY }}${{ env.DOCKER_CACHE_NAME }}-${{ matrix.platform }},mode=max,compression=zstd,force-compression=true
276+
cache-from: type=registry,ref=${{ env.DOCKER_CACHE_NAME }}
277+
cache-to: type=registry,ref=${{ env.DOCKER_CACHE_REGISTRY }}${{ env.DOCKER_CACHE_NAME }},mode=max,compression=zstd,force-compression=true
275278
build-args: |
276279
${{ env.DOCKER_IMAGE_ARGUMENTS }}
277280
tags: |
@@ -314,8 +317,8 @@ jobs:
314317
sbom: true
315318
provenance: mode=max
316319
platforms: linux/${{ matrix.platform }}
317-
cache-from: type=registry,ref=${{ env.DOCKER_CACHE_REGISTRY }}${{ env.DOCKER_CACHE_NAME }}-${{ matrix.platform }}
318-
cache-to: type=registry,ref=${{ env.DOCKER_CACHE_NAME }}-${{ matrix.platform }},mode=max,compression=zstd,force-compression=true
320+
cache-from: type=registry,ref=${{ env.DOCKER_CACHE_REGISTRY }}${{ env.DOCKER_CACHE_NAME }}
321+
cache-to: type=registry,ref=${{ env.DOCKER_CACHE_NAME }},mode=max,compression=zstd,force-compression=true
319322
build-args: |
320323
${{ env.DOCKER_IMAGE_ARGUMENTS }}
321324
tags: |

0 commit comments

Comments
 (0)