From 6304e4d4f06b55df05bba5f678c9b97ed7798235 Mon Sep 17 00:00:00 2001 From: nemanjam Date: Fri, 7 Jun 2024 21:03:22 +0200 Subject: [PATCH] use manual ssh config again in github actions --- .github/workflows/bash__deploy-nginx.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bash__deploy-nginx.yml b/.github/workflows/bash__deploy-nginx.yml index 852536a..dd6c4b7 100644 --- a/.github/workflows/bash__deploy-nginx.yml +++ b/.github/workflows/bash__deploy-nginx.yml @@ -42,14 +42,22 @@ jobs: run: yarn build - name: Set up SSH config - id: ssh-foo - uses: invi5H/ssh-action@v1 - with: - NAME: arm1 - SSH_HOST: ${{ secrets.REMOTE_HOST }} - SSH_USER: ${{ secrets.REMOTE_USERNAME }} - SSH_KEY: ${{ secrets.REMOTE_KEY_ED25519 }} - SSH_PORT: ${{ secrets.REMOTE_PORT }} + run: | + # Set up SSH key + mkdir -p ~/.ssh + echo "${{ secrets.REMOTE_KEY_ED25519 }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + + # Set up SSH config + echo "Host arm1" > ~/.ssh/config + echo " HostName ${{ secrets.REMOTE_HOST }}" >> ~/.ssh/config + echo " User ${{ secrets.REMOTE_USERNAME }}" >> ~/.ssh/config + echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config + echo " Port ${{ secrets.REMOTE_PORT }}" >> ~/.ssh/config + chmod 600 ~/.ssh/config + + # Add SSH server key to known_hosts + ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts - name: Run bash file with yarn run: yarn deploy:nginx