diff --git a/entrypoint.sh b/entrypoint.sh index da9aea6..2c1ef34 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,10 +4,12 @@ set -eu # Set deploy key SSH_PATH="$HOME/.ssh" -mkdir "$SSH_PATH" +# Create .ssh dir if it doesn't exist +[[ -d "$SSH_PATH" ]] || mkdir "$SSH_PATH" +# Place deploy_key into .ssh dir echo "$DEPLOY_KEY" > "$SSH_PATH/deploy_key" +# Set r+w to user only chmod 600 "$SSH_PATH/deploy_key" - # Do deployment sh -c "rsync $INPUT_SWITCHES -e 'ssh -i $SSH_PATH/deploy_key -o StrictHostKeyChecking=no' $INPUT_EXCLUDES $GITHUB_WORKSPACE/$INPUT_PATH $INPUT_UPLOAD_PATH"