Add SSH port variable
This commit is contained in:
@@ -26,4 +26,5 @@ jobs:
|
||||
RSYNC_USERHOST: user@example.host
|
||||
with:
|
||||
rsync-arguments: --archive --compress --delete --verbose
|
||||
ssh-port: '22'
|
||||
```
|
||||
|
||||
@@ -9,9 +9,15 @@ inputs:
|
||||
description: Rsync arguments
|
||||
required: false
|
||||
default: --archive --compress --delete --verbose
|
||||
ssh-port:
|
||||
description: SSH port
|
||||
required: false
|
||||
default: '22'
|
||||
|
||||
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
args:
|
||||
- ${{ inputs.rsync-arguments }}
|
||||
- ${{ inputs.ssh-port }}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
options="$1"
|
||||
ssh_port="$2"
|
||||
SSH_HOME="${HOME}/.ssh"
|
||||
SSH_KEYPATH="${SSH_HOME}/deploy_key"
|
||||
|
||||
@@ -12,5 +13,5 @@ chmod 600 "$SSH_KEYPATH"
|
||||
|
||||
echo "Deploying..."
|
||||
rsync $options \
|
||||
-e "ssh -i $SSH_KEYPATH -o StrictHostKeyChecking=no" \
|
||||
-e "ssh -p $ssh_port -i $SSH_KEYPATH -o StrictHostKeyChecking=no" \
|
||||
"$RSYNC_SOURCE" "$RSYNC_USERHOST":"$RSYNC_DESTINATION"
|
||||
|
||||
Reference in New Issue
Block a user