Skip to content

Commit

Permalink
Added: Workflow - login to ec2 and run docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhanshugautam2911 committed Oct 29, 2024
1 parent 19b6b00 commit 6bf6c8a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ jobs:

- name: Verify Pushed Image
run: docker pull sudhnashu2911/payment-pe:latest

- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
sudo docker pull sudhnashu2911/payment-pe
sudo docker stop web-app || true
sudo docker rm web-app || true
sudo docker run -d --name web-app -p 3005:3000 sudhnashu2911/payment-pe

0 comments on commit 6bf6c8a

Please sign in to comment.