From 819d9f34c02a111e85cf80592d7326fdba0cc178 Mon Sep 17 00:00:00 2001 From: Samil Date: Mon, 29 Jan 2024 15:18:07 +0545 Subject: [PATCH] next --- .github/workflows/run-server.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-server.yml b/.github/workflows/run-server.yml index f78fc97..5cdfc75 100644 --- a/.github/workflows/run-server.yml +++ b/.github/workflows/run-server.yml @@ -18,15 +18,17 @@ jobs: with: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: 'test' - + - name: Adding Known Hosts + run: ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts + - name: Update Git code on the server run: | - ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && git pull" + ssh ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && git pull" - name: Install dependencies run: | - ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && npm install" + ssh ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && npm install" - name: Start the Node.js application run: | - ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && npm start" + ssh ${{ secrets.REMOTE_USERNAME }}@${{ secrets.REMOTE_HOST }} "cd /home/ubuntu/devops_class/all_in_docker && npm start"