Skip to content

Commit ff0e045

Browse files
committed
Add no-cache option for force rebuild to bypass all Docker caching
- Add NO_CACHE output to cache strategy step - Pass no-cache parameter to docker/build-push-action - Ensures force_rebuild bypasses both GHA cache AND Docker layer cache - Fixes issue where arm64 build was using cached layers even with force_rebuild=true
1 parent f6aa552 commit ff0e045

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ jobs:
111111
if [[ "${{ inputs.force_rebuild }}" == "true" ]]; then
112112
echo "CACHE_FROM=" >> $GITHUB_OUTPUT
113113
echo "CACHE_TO=" >> $GITHUB_OUTPUT
114+
echo "NO_CACHE=true" >> $GITHUB_OUTPUT
114115
else
115116
echo "CACHE_FROM=type=gha,scope=${{ inputs.image_name }}" >> $GITHUB_OUTPUT
116117
echo "CACHE_TO=type=gha,mode=max,scope=${{ inputs.image_name }}" >> $GITHUB_OUTPUT
118+
echo "NO_CACHE=false" >> $GITHUB_OUTPUT
117119
fi
118120
119121
- name: 🐳 Build and push Docker image
@@ -126,6 +128,7 @@ jobs:
126128
labels: ${{ steps.meta.outputs.labels }}
127129
cache-from: ${{ steps.cache.outputs.CACHE_FROM }}
128130
cache-to: ${{ steps.cache.outputs.CACHE_TO }}
131+
no-cache: ${{ steps.cache.outputs.NO_CACHE }}
129132
platforms: linux/amd64,linux/arm64
130133
build-args: ${{ inputs.build_args }}
131134

0 commit comments

Comments
 (0)