From 9a75740cdb6240962511fd66aa7c7e61a3bfce99 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 15 May 2024 08:52:50 +0900 Subject: [PATCH] describe cache on workflow --- .github/workflows/docker-build.yaml | 15 +++++++++++++-- docker/autoware-openadk/docker-bake.hcl | 6 ------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 8d8281623d4..4052afa0f35 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -42,8 +42,19 @@ jobs: files: | docker/autoware-openadk/docker-bake.hcl targets: default - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + set: | + prebuilt.cache-from=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache + prebuilt.cache-to=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache,mode=max + prebuilt.tags=${{ steps.meta.outputs.tags }} + prebuilt.labels=${{ steps.meta.outputs.labels }} + devel.cache-from=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache + devel.cache-to=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache,mode=max + devel.tags=${{ steps.meta.outputs.tags }} + devel.labels=${{ steps.meta.outputs.labels }} + runtime.cache-from=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache + runtime.cache-to=type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:buildcache,mode=max + runtime.tags=${{ steps.meta.outputs.tags }} + runtime.labels=${{ steps.meta.outputs.labels }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/docker/autoware-openadk/docker-bake.hcl b/docker/autoware-openadk/docker-bake.hcl index a5f149efa13..86952e4f044 100644 --- a/docker/autoware-openadk/docker-bake.hcl +++ b/docker/autoware-openadk/docker-bake.hcl @@ -5,20 +5,14 @@ group "default" { target "prebuilt" { dockerfile = "docker/autoware-openadk/Dockerfile" target = "prebuilt" - cache-from = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache"] - cache-to = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache,mode=max"] } target "devel" { dockerfile = "docker/autoware-openadk/Dockerfile" target = "devel" -cache-from = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache"] - cache-to = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache,mode=max"] } target "runtime" { dockerfile = "docker/autoware-openadk/Dockerfile" target = "runtime" - cache-from = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache"] - cache-to = ["type=registry,ref=ghcr.io/youtalk/autoware:buildcache,mode=max"] }