diff --git a/action.yml b/action.yml index 5d351e8..53f469a 100644 --- a/action.yml +++ b/action.yml @@ -2,9 +2,9 @@ name: Kaniko description: Build a container image using Kaniko inputs: - Dockerfile: + dockerfile: description: The Dockerfile to pass to Kaniko - required: true + required: false image: description: Name and tag under which to upload the image required: true @@ -27,7 +27,16 @@ 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 - cat > 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 }}"