mirror of
https://github.com/ChenjxJames/SFTP-Deploy-Action.git
synced 2025-09-10 20:18:06 +08:00
Merge pull request #4 from JulianGro/ssh_mkdir
Create directory if needed
This commit is contained in:
@@ -58,7 +58,7 @@ args of sftp cmd, E.g.`-o ConnectTimeout=5`
|
||||
server: 'your server ip'
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
local_path: './static/*'
|
||||
remote_path: '/var/www/app' #make sure dir exist
|
||||
remote_path: '/var/www/app'
|
||||
args: '-o ConnectTimeout=5'
|
||||
|
||||
## 1. [Deploy React App Example](https://github.com/wlixcc/React-Deploy)
|
||||
|
@@ -12,8 +12,11 @@ printf "%s" "$4" >$TEMP_SSH_PRIVATE_KEY_FILE
|
||||
# avoid Permissions too open
|
||||
chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE
|
||||
|
||||
echo 'sftp start'
|
||||
echo 'ssh start'
|
||||
# create directory if needed
|
||||
ssh -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 mkdir -p $5
|
||||
|
||||
echo 'sftp start'
|
||||
# create a temporary file containing sftp commands
|
||||
printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE
|
||||
#-o StrictHostKeyChecking=no avoid Host key verification failed.
|
||||
|
Reference in New Issue
Block a user