-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (34 loc) · 1.02 KB
/
Copy pathdeploy.yml
File metadata and controls
48 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Backend CI/CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_IP }}
username: ${{ secrets.VPS_USER }}
password: ${{ secrets.VPS_PASSWORD }}
script: |
set -e
echo "🚀 Starting deployment..."
cd /var/www/pulse-ai
git reset --hard
git pull origin main
cd services/mri_analysis
# Create venv if missing
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
# Activate venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Restart or start PM2 service
pm2 restart mri-service || pm2 start app.py --interpreter python3 --name mri-service
pm2 save
echo "✅ Deployment completed successfully!"