Passing vars differently because of how broken it is

This commit is contained in:
2024-11-25 08:19:19 +01:00
parent a6a9e3ebd1
commit 9fd6055579
2 changed files with 11 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ inputs:
description: The dockerfile path
required: false
default: "."
pushImage:
push:
description: Should push the built image
required: false
default: "true"
@@ -36,10 +36,3 @@ outputs:
runs:
using: docker
image: Dockerfile
env:
INPUT_IMAGE_NAME: ${{ inputs.imageName }}
INPUT_IMAGE_PREFIX: ${{ inputs.imagePrefix }}
INPUT_PUSH_IMAGE: ${{ inputs.pushImage }}
INPUT_PULL_CACHE: ${{ inputs.pullCache }}
INPUT_DOCKERFILE_PATH: ${{ inputs.path }}
INPUT_PLATFORM: ${{ inputs.platform }}

View File

@@ -1,11 +1,18 @@
#!/usr/bin/env bash
INPUT_IMAGE_NAME=$imageName
INPUT_IMAGE_PREFIX=$imagePrefix
INPUT_PUSH_IMAGE=$push
INPUT_PULL_CACHE=$pullCache
INPUT_DOCKERFILE_PATH=$path
INPUT_PLATFORM=$platform
set -e
# shellcheck disable=SC2155
export LOWERCASE_INPUT_IMAGE_PREFIX="$(echo "$INPUT_IMAGE_PREFIX" | tr '[:upper:]' '[:lower:]')"
IMAGE_NAME="$(echo "$LOWERCASE_INPUT_IMAGE_PREFIX" | sed 's/^https\?:\/\///')$INPUT_IMAGE_NAME"
env
if [ -n "$DOCKER_CONFIG_BASE64" ]; then
echo "Retrieving docker config"
mkdir "$HOME/.docker/"
@@ -35,11 +42,12 @@ if [ "$INPUT_PULL_CACHE" = "true" ]; then
docker pull "$IMAGE_NAME" || echo "Unable to find an image to pull."
fi
DOCKER_BUILD_OPTIONS+=("${INPUT_DOCKERFILE_PATH}")
# shellcheck disable=SC2145
echo "Running docker buildx with options: ${DOCKER_BUILD_OPTIONS[@]}"
echo "Building and pushing !"
docker buildx build DOCKER_BUILD_OPTIONS[@] "${INPUT_DOCKERFILE_PATH}"
docker buildx build "${DOCKER_BUILD_OPTIONS[@]}"
echo "imageName=${IMAGE_NAME}" >>"$GITEA_OUTPUT"