mirror of
https://gitee.com/jack_whh/SFTP-Deploy-Action.git
synced 2026-03-13 16:32:55 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eefd2bdfdd | ||
|
|
20e64abc17 | ||
|
|
91b8b9544d | ||
|
|
7335acf980 | ||
|
|
c82544e20d | ||
|
|
397d4efe0e | ||
|
|
bcc301f18b | ||
|
|
06dc0da5d5 | ||
|
|
16826b94db | ||
|
|
046196ef61 | ||
|
|
2195f0da1f | ||
|
|
eade25f96d | ||
|
|
8eda311503 | ||
|
|
7d36dbb31e | ||
|
|
dcd5527d19 |
@@ -36,7 +36,9 @@ inputs:
|
|||||||
password:
|
password:
|
||||||
description: "SSH passsword,If a password is set, the secret key pair is ignored"
|
description: "SSH passsword,If a password is set, the secret key pair is ignored"
|
||||||
required: false
|
required: false
|
||||||
|
script:
|
||||||
|
description: "upload files after exec script"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
@@ -52,6 +54,7 @@ runs:
|
|||||||
- ${{ inputs.sftpArgs }}
|
- ${{ inputs.sftpArgs }}
|
||||||
- ${{ inputs.delete_remote_files }}
|
- ${{ inputs.delete_remote_files }}
|
||||||
- ${{ inputs.password }}
|
- ${{ inputs.password }}
|
||||||
|
- ${{ inputs.script }}
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'upload-cloud'
|
icon: 'upload-cloud'
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ fi
|
|||||||
|
|
||||||
# keep string format
|
# keep string format
|
||||||
printf "%s" "$4" >$TEMP_SSH_PRIVATE_KEY_FILE
|
printf "%s" "$4" >$TEMP_SSH_PRIVATE_KEY_FILE
|
||||||
echo "-------"
|
|
||||||
# avoid Permissions too open
|
# avoid Permissions too open
|
||||||
chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE
|
chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE
|
||||||
|
|
||||||
@@ -64,5 +63,23 @@ printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE
|
|||||||
#-o StrictHostKeyChecking=no avoid Host key verification failed.
|
#-o StrictHostKeyChecking=no avoid Host key verification failed.
|
||||||
sftp -b $TEMP_SFTP_FILE -P $3 $8 -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2
|
sftp -b $TEMP_SFTP_FILE -P $3 $8 -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2
|
||||||
|
|
||||||
|
|
||||||
|
if [ -z != ${11} ]; then
|
||||||
|
echo $11
|
||||||
|
script=$11
|
||||||
|
echo $script
|
||||||
|
echo "------"
|
||||||
|
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 "$script"
|
||||||
|
echo "-----"
|
||||||
|
script1="./usr/local/transport-api/restart.sh restart"
|
||||||
|
echo $script1
|
||||||
|
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 "$script1"
|
||||||
|
echo "-----"
|
||||||
|
script2="sh /usr/local/transport-api/restart.sh restart"
|
||||||
|
echo $scscript2ript
|
||||||
|
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 "$script2"
|
||||||
|
echo "-----"
|
||||||
|
|
||||||
|
fi
|
||||||
echo 'Deploy Success'
|
echo 'Deploy Success'
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user