Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/bakery-build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ on:
default: true
required: false
type: boolean
refresh-cache:
description: "Rebuild all layers without reading the build cache, but still write fresh layers to the cache registry [default: false]"
default: false
required: false
type: boolean
max-parallel:
description: "Maximum number of matrix jobs (build/test and merge) to run simultaneously [default: 0, unlimited]"
default: 0
Expand Down Expand Up @@ -391,13 +396,18 @@ jobs:
NORMALIZED_PLATFORM: ${{ steps.normalize-platform.outputs.platform }}
CONTEXT: ${{ inputs.context }}
CACHE: ${{ inputs.cache }}
REFRESH_CACHE: ${{ inputs.refresh-cache }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Cache-to is conditional on --push (handled by bakery internally)
run: |
CACHE_FLAGS=()
if [ "$CACHE" = "true" ]; then
CACHE_FLAGS=(--cache-registry "$CACHE_REGISTRY")
fi
# --no-cache skips cache reads only; cache-to still writes fresh layers to the registry
if [ "$REFRESH_CACHE" = "true" ]; then
CACHE_FLAGS+=(--no-cache)
fi
DEV_SPEC_FLAGS=()
[[ -n "$DEV_SPEC_RESOLVED" ]] && DEV_SPEC_FLAGS=(--dev-spec "$DEV_SPEC_RESOLVED")
bakery build \
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/bakery-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ on:
default: true
required: false
type: boolean
refresh-cache:
description: "Rebuild all layers without reading the build cache [default: false]"
default: false
required: false
type: boolean
cache-registry:
description: "Registry to use for build layer caching [default: ghcr.io/<repository_owner>]"
default: ""
Expand Down Expand Up @@ -312,12 +317,17 @@ jobs:
CACHE_REGISTRY: ${{ inputs.cache-registry || format('ghcr.io/{0}', github.repository_owner) }}
CONTEXT: ${{ inputs.context }}
CACHE: ${{ inputs.cache }}
REFRESH_CACHE: ${{ inputs.refresh-cache }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CACHE_FLAGS=()
if [ "$CACHE" = "true" ]; then
CACHE_FLAGS=(--cache-registry "$CACHE_REGISTRY")
fi
# Push step below reuses these freshly built local layers, so it needs no --no-cache
if [ "$REFRESH_CACHE" = "true" ]; then
CACHE_FLAGS+=(--no-cache)
fi
DEV_SPEC_FLAGS=()
[[ -n "$DEV_SPEC_RESOLVED" ]] && DEV_SPEC_FLAGS=(--dev-spec "$DEV_SPEC_RESOLVED")
bakery build --load --pull \
Expand Down
Loading