From f67f1fee7be21ab54a57a4c14a7e90d7b74810ab Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 22 Jun 2023 04:53:06 +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=ABlatest=EF=BC=88master=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=B3=E3=83=81=EF=BC=89=E3=81=AE=E3=83=AC=E3=82=A4=E3=83=A4?= =?UTF-8?q?=E3=83=BC=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#707)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 2b9276ae4..8a3d3a4cb 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) + ) }} with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -144,7 +151,7 @@ jobs: target: ${{ matrix.target }} push: true tags: ${{ env.IMAGE_TAG }} - cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache + cache-from: ${{ env.IMAGE_CACHE_FROM }} cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache,mode=max platforms: ${{ matrix.platforms }}