From ca8f52713b6e3e9f975f68d4595fd87094c68dd9 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 12 Jun 2024 04:08:56 +0900 Subject: [PATCH] feat(ci,docker): set multiple Docker build cache (#4852) Signed-off-by: Yutaka Kondo --- .github/workflows/build-main-self-hosted.yaml | 4 ++-- .github/workflows/build-main.yaml | 4 ++-- .../workflows/docker-build-and-push-main-self-hosted.yaml | 5 +++-- .github/workflows/docker-build-and-push-main.yaml | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml index 07e07e67a59..f6cc66a5ebd 100644 --- a/.github/workflows/build-main-self-hosted.yaml +++ b/.github/workflows/build-main-self-hosted.yaml @@ -64,8 +64,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 86380deb512..0e382eba987 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -59,8 +59,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index e91d46bb645..7c3832e14db 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -76,8 +76,9 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index fee5967c7d9..bb2e1e42dff 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -71,8 +71,9 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true