From 8a91d7be84e715c78985aa16f581d5413a159e11 Mon Sep 17 00:00:00 2001 From: Dmitriy Fofanov Date: Wed, 25 Feb 2026 00:31:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20SSH:=20=D1=81=D0=BE=D1=85=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B0=20=D1=81=20=D1=82=D0=BE=D1=87=D0=BD=D1=8B=D0=BC=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B0=20=D0=BA=D0=BB=D1=8E=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-service.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-service.yml b/.github/workflows/deploy-service.yml index de67075..009f748 100644 --- a/.github/workflows/deploy-service.yml +++ b/.github/workflows/deploy-service.yml @@ -199,8 +199,15 @@ jobs: mkdir -p ~/.ssh chmod 700 ~/.ssh - printf '%s\n' "${DEPLOY_SSH_PRIVATE_KEY}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 + # Save private key preserving exact formatting + # Use printf with %b to handle \n sequences, strip trailing whitespace issues + echo "${DEPLOY_SSH_PRIVATE_KEY}" | sed 's/\r//' > ~/.ssh/id_deploy + # Ensure file ends with a newline (required by OpenSSH) + echo "" >> ~/.ssh/id_deploy + chmod 600 ~/.ssh/id_deploy + + # Validate key and show fingerprint for debugging + echo ">>> Private key type: $(ssh-keygen -l -f ~/.ssh/id_deploy 2>&1 || echo 'INVALID KEY')" if [ -n "${DEPLOY_SSH_KNOWN_HOSTS:-}" ]; then printf '%s\n' "${DEPLOY_SSH_KNOWN_HOSTS}" > ~/.ssh/known_hosts @@ -219,7 +226,7 @@ jobs: echo " HostName ${DEPLOY_HOST}" echo " Port ${DEPLOY_PORT}" echo " User ${DEPLOY_USER}" - echo " IdentityFile ~/.ssh/id_ed25519" + echo " IdentityFile ~/.ssh/id_deploy" echo " UserKnownHostsFile ~/.ssh/known_hosts" echo " StrictHostKeyChecking accept-new" echo " ConnectTimeout 15"