From 0be40914076c732ebf9cb40e3ce14ab079566717 Mon Sep 17 00:00:00 2001 From: shaheennabi Date: Sat, 21 Dec 2024 11:46:59 -0800 Subject: [PATCH] updated --- .github/workflows/deploy.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 697bb5c..fda5af5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,13 +46,11 @@ jobs: - name: Deploy to EC2 run: | - ssh -i ${{ secrets.SSH_KEY }} ubuntu@44.210.129.170 \ + echo "${{ secrets.SSH_KEY }}" > ssh_key + chmod 600 ssh_key + ssh -i ssh_key -o StrictHostKeyChecking=no ubuntu@44.203.254.197 \ 'docker pull ${{ secrets.AWS_ECR_REPO_URI }}:latest && \ docker stop streamlit-app || true && \ docker rm streamlit-app || true && \ docker run -d --name streamlit-app -p 8501:8501 ${{ secrets.AWS_ECR_REPO_URI }}:latest' - - - name: Cleanup Old Images - if: always() - run: | - docker system prune -af \ No newline at end of file + rm ssh_key \ No newline at end of file