1
0
Fork 0
mirror of https://github.com/aevea/action-kaniko.git synced 2025-04-20 00:58:15 +02:00

Initial commit

This commit is contained in:
Alex Viscreanu 2020-02-15 18:55:26 +01:00
commit dc53dd09d6
No known key found for this signature in database
GPG key ID: 60A6BD7F046C850B
5 changed files with 142 additions and 0 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
*
!entrypoint.sh

75
.gitignore vendored Normal file
View file

@ -0,0 +1,75 @@
#### joe made this: http://goel.io/joe
#####=== macOS ===#####
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
#####=== Windows ===#####
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
#####=== Linux ===#####
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
#####=== Custom ===#####
.direnv
.envrc
.env

5
Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM gcr.io/kaniko-project/executor:debug
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

27
action.yml Normal file
View file

@ -0,0 +1,27 @@
# kaniko.yml
name: "Kaniko builder"
description: "Build and push docker images using Kaniko"
inputs:
registry:
description: "Docker registry where the image will be pushed"
required: false
default: "docker.io"
username:
description: "Username used for authentication to the Docker registry"
required: false
default: "$GITHUB_ACTOR"
password:
description: "Password used for authentication to the Docker registry"
required: false
default: "$GITHUB_TOKEN"
image:
description: "Image name"
required: false
default: "$GITHUB_REPOSITORY"
tag:
description: "Image tag"
required: false
default: "$GITHUB_REF (master -> latest)"
runs:
using: "docker"
image: "Dockerfile"

32
entrypoint.sh Executable file
View file

@ -0,0 +1,32 @@
#!/busybox/sh
set -e pipefail
export REGISTRY=${INPUT_REGISTRY:-"docker.io"}
export IMAGE=${INPUT_IMAGE:-$GITHUB_REPOSITORY}
export TAG=${INPUT_TAG:-$([ "$GITHUB_REF" == "master" ] && echo latest || echo $GITHUB_REF)}
export TAG=${TAG:-"latest"}
export USERNAME=${INPUT_USERNAME:-$GITHUB_ACTOR}
export PASSWORD=${INPUT_PASSWORD:-$GITHUB_TOKEN}
if[ "$INPUT_CACHE" == "true" ]; then
export CACHE="--cache=true --cache-ttl=${INPUT_CACHE_TTL:-168h}";
fi
export CONTEXT="--context $GITHUB_WORKSPACE"
export DOCKERFILE="--dockerfile ${INPUT_BUILD_FILE:-Dockerfile}"
export DESTINATION="--destination $REGISTRY/$IMAGE${IMAGE_NAMESPACE}:$TAG"
export ARGS="$CACHE $CONTEXT $DOCKERFILE $DESTINATION $EXTRA"
cat << EOF > /kaniko/.docker/config.json
{
"auths": {
"${REGISTRY}": {
"username": "${USERNAME}",
"password": "${PASSWORD}"
}
}
}
EOF
/kaniko/executor $ARGS