Initial commit

This commit is contained in:
2024-11-24 11:32:32 +01:00
commit c3b90db9e6
4 changed files with 75 additions and 0 deletions

29
entrypoint.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/bin/sh -l
IMAGE_NAME="$(echo "$INPUT_IMAGE_PREFIX" | sed 's/^https\?:\/\///')$INPUT_IMAGE_NAME"
echo "::notice file=entrypoint.sh,line=7::$IMAGE_NAME"
if [ -z "$INPUT_IMAGE_NAME" ]; then
echo "No image name given."
exit 1
fi;
if [ "$INPUT_PUSH" = "true" ]; then
DOCKER_BUILD_OPTIONS="${DOCKER_BUILD_OPTIONS} --push"
fi
if [ "$INPUT_PULL_CACHE" = "true" ]; then
# shellcheck disable=SC2089
DOCKER_BUILD_OPTIONS="${DOCKER_BUILD_OPTIONS} --cache-from \"$IMAGE_NAME\""
echo "Pulling for cache"
docker pull "$1" || echo "No image found."
fi
echo "Building and pushing !"
# shellcheck disable=SC2090
docker buildx build ${DOCKER_BUILD_OPTIONS} -t "$IMAGE_NAME" --progress plain
echo "imageName=${IMAGE_NAME}" >>"$GITEA_OUTPUT"
exit 0