need to add newline to end of private key file
Some checks failed
/ Deploy website to server (push) Failing after 14s

This commit is contained in:
2025-05-02 00:42:50 +01:00
parent c3d884ac76
commit a68328527e

View File

@@ -20,12 +20,15 @@ jobs:
tags: tag:ci
- name: Add SSH key
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
MACHINE_IP="$(tailscale ip -4 $MACHINE)"
ssh-keyscan $MACHINE_IP >> ~/.ssh/known_hosts
printf "%s" "$SSH_KEY" > ~/.ssh/key
printf "%s" "$SSH_PRIVATE_KEY" > ~/.ssh/key
# add a new line to the end of the private key file
# otherwise it won't be loaded properly
echo >> ~/.ssh/key
chmod 600 ~/.ssh/key
- name: Deploy website
run: |