From 7af3972cb0673e10ad01c72399956f340ea901ff Mon Sep 17 00:00:00 2001 From: devout-coder Date: Sat, 7 Sep 2024 18:16:47 +0530 Subject: [PATCH] finally got it right --- .github/workflows/deploy.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6e7224..cca3e62 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -55,13 +55,10 @@ jobs: run: | ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts - - name: SSH into EC2 instance and execute a command + - name: SSH into EC2 instance and pull run: | ssh -i ~/.ssh/id_rsa ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} - - - name: Pull images and deploy - run: | - cd ~/doneify_dir - docker-compose pull doneify - docker-compose down - docker-compose up -d + cd ~/doneify_dir + docker-compose pull doneify + docker-compose down + docker-compose up -d