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"