From 5db3935fbe1879a15c58a097bf93a055524d84da Mon Sep 17 00:00:00 2001 From: Martin op iMac Date: Mon, 30 Oct 2023 09:00:39 +0100 Subject: [PATCH] Added ssh key to workflow secret 2 --- .github/workflows/continuous-deployment.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 6ae536e..40e3fc6 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -34,12 +34,17 @@ jobs: run: | python3 -m pytest - - name: Add Linode server to known hosts - run: | - mkdir -p ~/.ssh - ssh-keyscan 172.233.46.163 >> ~/.ssh/known_hosts - - name: Deploy to Linode if: ${{ success() }} - run: | - ssh root@172.233.46.163 'cd /var/www/html/ && git pull origin main && systemctl restart gunicorn && systemctl restart nginx && gunicorn main:app --bind 0.0.0.0' \ No newline at end of file + uses: root@172.233.46.163 + with: + host: 172.233.46.163 + username: root + key: ${{ secrets.GH_SECRET }} + port: 22 + script: | + cd /var/www/html/ + git pull origin main + systemctl restart gunicorn + systemctl restart nginx + gunicorn main:app --bind \ No newline at end of file