Skip to content

Commit 4192f4a

Browse files
committed
fix
1 parent 0ce974e commit 4192f4a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

actions/build-push-docker/action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,17 @@ runs:
326326
'type=gha,timeout=10m,mode=max,ignore-error=true,scope=generic-${{
327327
runner.os }}-${{ runner.arch }}' }}
328328
run: |
329+
if [[ "${DOCKER_SAVE_CACHE}" == "true" ]]; then
330+
echo "cache-to=${DOCKER_BUILD_CACHE_TO}" | tee -a "${GITHUB_OUTPUT}"
331+
fi
332+
329333
if [[ "${DOCKER_RESTORE_CACHE}" == "false" ]]; then
330-
echo "no-cache=false" | tee -a "${GITHUB_OUTPUT}"
331-
echo "cache-from=${DOCKER_BUILD_CACHE_FROM}" | tee -a "${GITHUB_OUTPUT}"
332-
else
333334
echo "no-cache=true" | tee -a "${GITHUB_OUTPUT}"
335+
exit 0
334336
fi
335337
336-
if [[ "${DOCKER_SAVE_CACHE}" == "true" ]]; then
337-
echo "cache-to=${DOCKER_BUILD_CACHE_TO}" | tee -a "${GITHUB_OUTPUT}"
338-
fi
338+
echo "no-cache=false" | tee -a "${GITHUB_OUTPUT}"
339+
echo "cache-from=${DOCKER_BUILD_CACHE_FROM}" | tee -a "${GITHUB_OUTPUT}"
339340
340341
- name: Build & push image
341342
id: build-image
@@ -359,6 +360,7 @@ runs:
359360
tags: ${{ steps.docker-meta.outputs.tags }}
360361
labels: ${{ steps.docker-meta.outputs.labels }}
361362
platforms: ${{ inputs.platform }}
363+
# disables cache when building image
362364
no-cache: ${{ steps.docker-cache.outputs.no-cache }}
363365
cache-from: ${{ steps.docker-cache.outputs.docker-cache-from }}
364366
cache-to: ${{ steps.docker-cache.outputs.docker-cache-to }}

0 commit comments

Comments
 (0)