diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c60674c..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cSpell.words": ["elif", "kaniko"] -} diff --git a/action.yml b/action.yml index 53f469a..3d61d87 100644 --- a/action.yml +++ b/action.yml @@ -1,17 +1,17 @@ --- + name: Kaniko description: Build a container image using Kaniko inputs: - dockerfile: + Dockerfile: description: The Dockerfile to pass to Kaniko - required: false + required: true image: description: Name and tag under which to upload the image required: true registry: description: Domain of the registry. Should be the same as the first path component of the tag. - required: false - default: https://index.docker.io/v1/ + required: true username: description: Username for the container registry required: true @@ -27,16 +27,7 @@ runs: - | mkdir -p /kaniko/.docker echo '{"auths":{"${{ inputs.registry }}":{"auth":"'$(printf "%s:%s" "${{ inputs.username }}" "${{ inputs.password }}" | base64 | tr -d '\n')'"}}}' > /kaniko/.docker/config.json - - if [ -n "${{ inputs.dockerfile }}" ]; then - echo "Using Dockerfile from input" - echo "${{ inputs.dockerfile }}" > Dockerfile - elif [ -f "./Dockerfile" ]; then - echo "Using existing ./Dockerfile from workspace" - cp ./Dockerfile Dockerfile - else - echo "ERROR: No Dockerfile provided and no ./Dockerfile found in workspace" - exit 1 - fi - - /kaniko/executor --dockerfile Dockerfile --destination "${{ inputs.image }}" + cat > Dockerfile <