diff --git a/.github/actions/build-container-image/action.yml b/.github/actions/build-container-image/action.yml index be292a8e5..bf2eb5d2e 100644 --- a/.github/actions/build-container-image/action.yml +++ b/.github/actions/build-container-image/action.yml @@ -102,16 +102,21 @@ inputs: The source image repository from which to cache layers during the build. This can help improve build speed by reusing layers from a previously built image. + Default: type=gha + Example: 'docker.io/my-app:cache' to cache from a specific image. + default: |- + type=gha cache_to: description: > The destination image cache settings to optimize the caching strategy during the build. This input specifies where to store cached layers and how they are scoped. - Values provided here will be appended to any default cache settings. - Predefined values may already be present, and any inputs provided here will be appended. + Default: type=gha,mode=max Example: "type=gha,mode=max,scope=\$\{\{ github.workflow \}\}" + default: |- + type=gha,mode=max push_image: required: true default: "false" @@ -156,10 +161,8 @@ runs: provenance: ${{ inputs.image_provenance }} sbom: ${{ inputs.image_sbom }} cache-from: | - type=gha ${{ inputs.cache_from }} cache-to: | - type=gha,mode=max ${{ inputs.cache_to }} tags: | ${{ inputs.image_tags }} diff --git a/.github/workflows/build-container-images.yml b/.github/workflows/build-container-images.yml index 4a3cba879..4129ced73 100644 --- a/.github/workflows/build-container-images.yml +++ b/.github/workflows/build-container-images.yml @@ -78,3 +78,9 @@ jobs: build_target: dev dockerfile: dockerfiles/bloodhound.Dockerfile push_image: ${{ inputs.push_image }} + cache_from: |- + type=registry,ref=specterops/bloodhound:buildcache + cache_to: |- + type=registry,ref=specterops/bloodhound:buildcache,mode=max + +