🐛 Respect no_push in multi platform builds

Fixes https://github.com/elgohr/Publish-Docker-Github-Action/issues/215
This commit is contained in:
Lars Gohr
2025-05-22 20:37:55 +02:00
parent c46a598c75
commit 4feac4d53e
2 changed files with 56 additions and 1 deletions

View File

@@ -192,7 +192,11 @@ build() {
done
if uses "${INPUT_PLATFORMS}"; then
local PLATFORMS="--platform ${INPUT_PLATFORMS}"
docker buildx build --push --metadata-file metadata.json ${PLATFORMS} ${INPUT_BUILDOPTIONS} ${BUILDPARAMS} ${BUILD_TAGS} ${CONTEXT}
local PUSHING="--push"
if usesBoolean "${INPUT_NO_PUSH}"; then
PUSHING=""
fi
docker buildx build ${PUSHING} --metadata-file metadata.json ${PLATFORMS} ${INPUT_BUILDOPTIONS} ${BUILDPARAMS} ${BUILD_TAGS} ${CONTEXT}
else
docker build ${INPUT_BUILDOPTIONS} ${BUILDPARAMS} ${BUILD_TAGS} ${CONTEXT}
fi