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 tags: tag:ci
- name: Add SSH key - name: Add SSH key
env: env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
MACHINE_IP="$(tailscale ip -4 $MACHINE)" MACHINE_IP="$(tailscale ip -4 $MACHINE)"
ssh-keyscan $MACHINE_IP >> ~/.ssh/known_hosts 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 chmod 600 ~/.ssh/key
- name: Deploy website - name: Deploy website
run: | run: |