From 39747666aa0895699e188f3fd03a0f448c9cf746 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 22 Jun 2023 04:57:48 +0900 Subject: [PATCH] =?UTF-8?q?Docker=E3=83=93=E3=83=AB=E3=83=89CI:=20?= =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E3=83=93=E3=83=AB=E3=83=89?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=82=92push=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#708)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hiroshiba --- .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 8a3d3a4cb..10258664a 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -135,6 +135,15 @@ jobs: 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 + ${{ ( + 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 }} @@ -152,7 +161,7 @@ jobs: push: true tags: ${{ env.IMAGE_TAG }} cache-from: ${{ env.IMAGE_CACHE_FROM }} - cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache,mode=max + cache-to: ${{ env.IMAGE_CACHE_TO }} platforms: ${{ matrix.platforms }} run-release-test-workflow: