kaniko/build.sh
2024-05-02 17:10:52 +02:00

20 lines
424 B
Bash
Executable File

#!/bin/sh -ex
cat <<EOF > /kaniko/.docker/config.json
{
"auths": {
"$GITHUB_SERVER_URL": {
"username": "$INPUT_USERNAME",
"password": "$INPUT_PASSWORD"
}
}
}
EOF
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
/kaniko/executor \
--cache=true \
--context "${INPUT_DOCKERFILE%/*}" \
--dockerfile "$INPUT_DOCKERFILE" \
--destination "$REGISTRY/$GITHUB_REPOSITORY:$INPUT_TAG"