diff --git a/action.yaml b/action.yaml index 887b1c9..99067e8 100644 --- a/action.yaml +++ b/action.yaml @@ -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 }} diff --git a/build.sh b/build.sh index a4a1683..e656c31 100755 --- a/build.sh +++ b/build.sh @@ -3,8 +3,6 @@ # source environment from args eval "$*" -ACTION=/kaniko/executor - cat < /kaniko/.docker/config.json { "auths": { @@ -16,12 +14,8 @@ cat < /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"