From 153bafea4de695dd8b82e7eac650ff43c994dec5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 21 Jun 2023 21:24:12 +0900 Subject: [PATCH 1/2] no release buildcache --- .github/workflows/build-docker.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 2837b69c6..ad620a7f9 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -128,6 +128,15 @@ jobs: format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, needs.config.outputs.version_or_latest) ) || format('{0}:{1}', env.IMAGE_NAME, needs.config.outputs.version_or_latest) ) }} + IMAGE_CACHE_TO: + |- # If it's a release, do not create buildcache, otherwise create the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache + ${{ ( + needs.config.outputs.version_or_latest == 'latest' && ( + matrix.tag != '' && ( + format('type=registry,ref={0}:{1}-latest-buildcache,mode=max', env.IMAGE_NAME, matrix.tag) + ) || format('type=registry,ref={0}:latest-buildcache,mode=max', env.IMAGE_NAME) + ) || '' + ) }} with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -145,7 +154,7 @@ jobs: push: true tags: ${{ env.IMAGE_TAG }} cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache - cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache,mode=max + cache-to: ${{ env.IMAGE_CACHE_TO }} platforms: ${{ matrix.platforms }} run-release-test-workflow: From 720ff6dfcbecca3d3823a20f50f947cbdd876bb9 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Thu, 22 Jun 2023 04:57:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?from=E3=81=A8to=E3=81=8C=E5=85=A5=E3=82=8C?= =?UTF-8?q?=E6=9B=BF=E3=82=8F=E3=81=A3=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=8C=E6=B0=97=E3=81=AB=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ca68af353..10258664a 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -128,6 +128,13 @@ jobs: format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, needs.config.outputs.version_or_latest) ) || format('{0}:{1}', env.IMAGE_NAME, needs.config.outputs.version_or_latest) ) }} + IMAGE_CACHE_FROM: + |- # Always use the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache + ${{ ( + matrix.tag != '' && ( + format('type=registry,ref={0}:{1}-latest-buildcache', env.IMAGE_NAME, matrix.tag) + ) || format('type=registry,ref={0}:latest-buildcache', env.IMAGE_NAME) + ) }} IMAGE_CACHE_TO: |- # If it's a release, do not create buildcache, otherwise create the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache ${{ ( @@ -137,13 +144,6 @@ jobs: ) || format('type=registry,ref={0}:latest-buildcache,mode=max', env.IMAGE_NAME) ) || '' ) }} - IMAGE_CACHE_FROM: - |- # Always use the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache - ${{ ( - matrix.tag != '' && ( - format('type=registry,ref={0}:{1}-latest-buildcache', env.IMAGE_NAME, matrix.tag) - ) || format('type=registry,ref={0}:latest-buildcache', env.IMAGE_NAME) - ) }} with: context: . builder: ${{ steps.buildx.outputs.name }}