mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2024-11-24 16:33:46 +01:00
fix 'mkdir: cannot create directory' error
Fix ``mkdir: cannot create directory '/github/home/.ssh': File exists`` error
This commit is contained in:
parent
8ad6165315
commit
0370813668
1 changed files with 4 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue