mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2024-11-22 07:23:46 +01:00
new inputs and shell
This commit is contained in:
parent
1eb5088cc2
commit
72f04677de
1 changed files with 8 additions and 7 deletions
|
@ -1,17 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Set deploy key
|
# Set deploy key
|
||||||
SSH_PATH="$HOME/.ssh"
|
SSH_PATH="$HOME/.ssh"
|
||||||
|
|
||||||
# Create .ssh dir if it doesn't exist
|
# Create .ssh dir if it doesn't exist
|
||||||
if [ ! -d "$SSH_PATH" ]; then
|
[ -d "$SSH_PATH" ] || mkdir "$SSH_PATH"
|
||||||
mkdir "$SSH_PATH"
|
|
||||||
fi
|
|
||||||
# Place deploy_key into .ssh dir
|
# Place deploy_key into .ssh dir
|
||||||
echo "$DEPLOY_KEY" > "$SSH_PATH/deploy_key"
|
echo "$INPUT_REMOTE_KEY" > "$SSH_PATH/key"
|
||||||
|
|
||||||
# Set r+w to user only
|
# Set r+w to user only
|
||||||
chmod 600 "$SSH_PATH/deploy_key"
|
chmod 600 "$SSH_PATH/key"
|
||||||
|
|
||||||
# Do deployment
|
# Do deployment
|
||||||
sh -c "rsync $INPUT_SWITCHES -e 'ssh -i $SSH_PATH/deploy_key -o StrictHostKeyChecking=no $INPUT_RSH' $GITHUB_WORKSPACE/$INPUT_PATH $INPUT_UPLOAD_PATH"
|
sh -c "rsync $INPUT_SWITCHES -e 'ssh -i $SSH_PATH/key -o StrictHostKeyChecking=no $INPUT_RSH' $GITHUB_WORKSPACE/$INPUT_PATH $INPUT_REMOTE_USER@$INPUT_REMOTE_HOST:$INPUT_REMOTE_PATH"
|
||||||
|
|
Loading…
Reference in a new issue