feat: add ssh port variable to use secret

This commit is contained in:
2025-09-25 17:50:36 +03:00
parent 3585b10ee0
commit 473301980a

View File

@@ -36,6 +36,7 @@ runs:
DOCKER_COMPOSE_PATH: ${{ inputs.docker_compose_path }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
SSH_PORT: ${{ secrets.SSH_PORT }}
TIMEOUT: ${{ inputs.timeout }}
# Optional: Set timeout for the entire action
@@ -64,7 +65,7 @@ runs:
echo "${DOCKER_COMPOSE_PATH}"
echo "${REMOTE_USER}@${REMOTE_HOST}:${DEPLOYMENT_PATH}"
mkdir -p "$(dirname "${DEPLOYMENT_PATH}")"
scp -o StrictHostKeyChecking=yes -P 2223 \
scp -o StrictHostKeyChecking=yes -P $SSH_PORT \
-o UserKnownHostsFile=~/.ssh/known_hosts \
-i ~/.ssh/id_rsa \
${DOCKER_COMPOSE_PATH} \
@@ -73,7 +74,7 @@ runs:
- name: Deploy services via SSH
run: |
ssh -o StrictHostKeyChecking=yes -p 2223 \
ssh -o StrictHostKeyChecking=yes -p $SSH_PORT \
-o UserKnownHostsFile=~/.ssh/known_hosts \
-i ~/.ssh/id_rsa \
"${REMOTE_USER}@${REMOTE_HOST}" \
@@ -82,7 +83,7 @@ runs:
- name: Verify services are running
run: |
ssh -o StrictHostKeyChecking=yes -p 2223 \
ssh -o StrictHostKeyChecking=yes -p $SSH_PORT \
-o UserKnownHostsFile=~/.ssh/known_hosts \
-i ~/.ssh/id_rsa \
"${REMOTE_USER}@${REMOTE_HOST}" \