Skip to content

Commit

Permalink
Update deploy-ec2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermazi authored Oct 7, 2024
1 parent 1228478 commit c8753d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ jobs:
port: 22
script: |
# Stop and remove all running containers if they exist
if [ "$(docker ps -q)" ]; then
docker stop $(docker ps -q)
if [ "$(sudo docker ps -q)" ]; then
sudo docker stop $(docker ps -q)
fi
if [ "$(docker ps -aq)" ]; then
docker rm $(docker ps -aq)
if [ "$(sudo docker ps -aq)" ]; then
sudo docker rm $(docker ps -aq)
fi
# Run the new Docker image
docker run -d -p 3000:3000 --name node-app my-new-image:latest
sudo docker run -d -p 3000:3000 --name node-app my-new-image:latest

0 comments on commit c8753d6

Please sign in to comment.