fix: remove unused variables + https from url

This commit is contained in:
ange 2024-04-30 23:12:36 +02:00
parent dab3dad0c4
commit 2c7bab8c91
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 9 additions and 25 deletions

View File

@ -1,17 +1,12 @@
name: kaniko
inputs:
dockerfile:
description: Dockerfile path
required: true
default: ./Dockerfile
registry:
description: Registry URL
tag:
description: Image tag
required: true
default: ${{ gitea.server_url }}
image:
description: Image name
required: true
default: ${{ gitea.repository }}:latest
default: ${{ gitea.ref_name }}
username:
description: Registry username
required: true
@ -19,19 +14,14 @@ inputs:
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_TAG=${{ inputs.tag }}
- ACTION_REGISTRY=${{ gitea.server_url }}
- ACTION_IMAGE=${{ gitea.repository }}
- ACTION_USERNAME=${{ inputs.username }}
- ACTION_PASSWORD=${{ inputs.password }}
- ACTION_TLS=${{ inputs.tls }}

View File

@ -3,8 +3,6 @@
# source environment from args
eval "$*"
ACTION=/kaniko/executor
cat <<EOF > /kaniko/.docker/config.json
{
"auths": {
@ -16,12 +14,8 @@ cat <<EOF > /kaniko/.docker/config.json
}
EOF
case "$ACTION_TLS" in
[fF]alse) ACTION="$ACTION --insecure" ;;
*) ;;
esac
exec $ACTION \
REGISTRY="$(echo "$ACTION_REGISTRY" | sed 's .*:// ')"
/kaniko/executor \
--context "${ACTION_DOCKERFILE%/*}" \
--dockerfile "$ACTION_DOCKERFILE" \
--destination "$ACTION_REGISTRY/$ACTION_IMAGE"
--destination "$REGISTRY/$ACTION_IMAGE:$ACTION_TAG"