first commit

This commit is contained in:
ange 2024-04-28 23:16:33 +02:00
commit 71166e2407
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
4 changed files with 67 additions and 0 deletions

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM gcr.io/kaniko-project/executor:debug
COPY build.sh /usr/local/bin/
ENTRYPOINT ["build.sh"]

1
README.md Normal file
View File

@ -0,0 +1 @@
# kaniko@v1

37
action.yaml Normal file
View File

@ -0,0 +1,37 @@
name: kaniko
inputs:
dockerfile:
description: Dockerfile path
required: true
default: ./Dockerfile
registry:
description: Registry URL
required: true
default: git.gmoker.com
image:
description: Image name
required: true
default: ${{ gitea.repository }}:latest
username:
description: Registry username
required: true
default: ${{ gitea.repository_owner }}
password:
description: Registry password
required: true
default: ${{ gitea.token }}
tls:
description: Prevent push to http
required: true
default: true
runs:
using: docker
image: Dockerfile
args:
- ACTION_DOCKERFILE=${{ inputs.dockerfile }}
- ACTION_REGISTRY=${{ inputs.registry }}
- ACTION_IMAGE=${{ inputs.image }}
- ACTION_USERNAME=${{ inputs.username }}
- ACTION_PASSWORD=${{ inputs.password }}
- ACTION_TLS=${{ inputs.tls }}

26
build.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh -ex
# source environment from args
eval "$*"
ACTION=/kaniko/executor
cat <<EOF > /kaniko/.docker/config.json
{
"auths": {
"$ACTION_REGISTRY": {
"username": "$ACTION_USERNAME",
"password": "$ACTION_PASSWORD"
}
}
}
EOF
case "$ACTION_TLS" in
[fF]alse) ACTION="$ACTION --insecure" ;;
*) ;;
esac
exec $ACTION \
--dockerfile "$ACTION_DOCKERFILE" \
--destination "$ACTION_REGISTRY/$ACTION_IMAGE"