From 61b0a93920f2f841dae5baaaf8d4720c59647608 Mon Sep 17 00:00:00 2001 From: ange Date: Sun, 19 May 2024 13:42:29 +0200 Subject: [PATCH] feat: source .env if exists --- build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index ed10246..a31a47f 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/sh -ex +. ./.env || true + cat < /kaniko/.docker/config.json { "auths": { @@ -11,9 +13,13 @@ cat < /kaniko/.docker/config.json } EOF -REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')" +if [ -z "$IMAGEAPP" ]; then + REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')" + IMAGEAPP="$REGISTRY/$INPUT_IMAGE" +fi + /kaniko/executor \ --cache=true \ --context "${INPUT_DOCKERFILE%/*}" \ --dockerfile "$INPUT_DOCKERFILE" \ - --destination "$REGISTRY/$INPUT_IMAGE" + --destination "$IMAGEAPP"