From 6cd36202eeb42a1198227bf8e2056c4845e0a1ed Mon Sep 17 00:00:00 2001 From: Jonas Simoen Date: Sat, 21 Oct 2023 13:40:04 +0200 Subject: [PATCH] fix(deploy): using passphrase for private ssh key --- .github/workflows/deploy.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9b9710d..96cad09 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,6 +14,10 @@ jobs: SERVER_IP: ${{secrets.SERVER_IP}} NODE_OPTIONS: --max-old-space-size=2048 steps: + - name: Setup SSH + run: | + echo 'echo ${{secrets.SSH_PWD}}' > ~/.ssh/passphrase && chmod 700 ~/.ssh/passphrase + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - run: npm install yarn -g @@ -25,7 +29,7 @@ jobs: run: | which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) eval $(ssh-agent -s) - ssh-add <(echo "$SSH_PRIVATE_KEY" ) + cat ${{secrets.SSH_KEY}} | tr -d '\r' | DISPLAY=None SSH_ASKPASS=~/.ssh/passphrase ssh-add - mkdir -p ~/.ssh chmod 700 ~/.ssh ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts