Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirAgassi committed Nov 23, 2024
1 parent 671caad commit 0ae927c
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,8 @@ jobs:
--exclude '*.pyc' \
./backend/ [email protected]:/home/ubuntu/backend/
- name: Setup and install dependencies
- name: Run deployment script
env:
SSH_PASS: ${{ secrets.SSH_PASSWORD }}
run: |
sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no [email protected] '
cd /home/ubuntu/backend && \
python3 -m venv venv && \
source venv/bin/activate && \
pip install -r requirements.txt && \
# Kill any existing uvicorn process
pkill -f uvicorn || true && \
# Create a startup script
echo "#!/bin/bash
cd /home/ubuntu/backend
source venv/bin/activate
exec venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000" > start.sh && \
chmod +x start.sh && \
# Run the startup script
nohup ./start.sh > server.log 2>&1 &
sleep 5 && \
# Verify the server is running
ps aux | grep uvicorn
'
sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no [email protected] 'bash /home/ubuntu/backend/deploy.sh'

0 comments on commit 0ae927c

Please sign in to comment.