Skip to content

Commit

Permalink
feat: Add custom cache settings for BloodHound container image build
Browse files Browse the repository at this point in the history
  • Loading branch information
neumachen committed Dec 9, 2024
1 parent 76eecea commit 1fa3aa0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/actions/build-container-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1fa3aa0

Please sign in to comment.