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