From 24018208b182eb9e1e62603cb0b635713df80964 Mon Sep 17 00:00:00 2001 From: Roy Nilsson Date: Thu, 21 Dec 2023 11:53:43 +0100 Subject: [PATCH] Add SSH port variable --- README.md | 1 + action.yml | 6 ++++++ deploy.sh | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6892553..6888cb2 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,5 @@ jobs: RSYNC_USERHOST: user@example.host with: rsync-arguments: --archive --compress --delete --verbose + ssh-port: '22' ``` diff --git a/action.yml b/action.yml index bbe941f..47c4bf2 100644 --- a/action.yml +++ b/action.yml @@ -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 }} diff --git a/deploy.sh b/deploy.sh index e162fef..da77123 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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"