kaniko/build.sh

20 lines
407 B
Bash
Raw Normal View History

2024-05-02 15:10:52 +00:00
#!/bin/sh -ex
2024-04-28 21:16:33 +00:00
2024-05-02 15:10:52 +00:00
cat <<EOF > /kaniko/.docker/config.json
2024-04-28 21:16:33 +00:00
{
"auths": {
2024-05-02 15:10:52 +00:00
"$GITHUB_SERVER_URL": {
"username": "$INPUT_USERNAME",
"password": "$INPUT_PASSWORD"
2024-04-28 21:16:33 +00:00
}
}
}
EOF
2024-05-02 15:10:52 +00:00
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
/kaniko/executor \
--cache=true \
--context "${INPUT_DOCKERFILE%/*}" \
--dockerfile "$INPUT_DOCKERFILE" \
2024-05-10 10:49:09 +00:00
--destination "$REGISTRY/$INPUT_IMAGE"