Skip to content

Commit

Permalink
modified EC2 workflows3
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-wt committed Dec 21, 2024
1 parent 394cc9a commit 778b944
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ jobs:
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
# Ensure there's space available before proceeding
df -h
# Pull the latest image from Docker Hub
sudo docker pull akashwt/myapp:latest
# Stop and remove any existing container with the same name
sudo docker stop myapp || true
sudo docker rm myapp || true
# Run the new container with the correct ports and environment variables
sudo docker run -d --name myapp -p 3005:3000 \
-e JWT_SECRET=${{ secrets.JWT_SECRET }} \
-e NEXTAUTH_URL=http://3.110.194.177:3005 \
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \
--restart always \
--restart always \
akashwt/myapp:latest

0 comments on commit 778b944

Please sign in to comment.