Skip to content

Commit ec2dd33

Browse files
isolate dev deployment resources and update sqlite web url (#39)
1 parent 21b1d53 commit ec2dd33

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy to Server (Dev)
22

33
on:
44
push:
5-
branches: [ "dev" ]
5+
branches: [ "main", "dev" ]
66

77
jobs:
88
deploy:
@@ -17,26 +17,30 @@ jobs:
1717
with:
1818
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
1919

20-
- name: Deploy on server
20+
# =========================
21+
# 🚀 DEPLOY STAGING (DEV)
22+
# =========================
23+
- name: Deploy to DEV Server
24+
if: github.ref == 'refs/heads/dev'
2125
run: |
2226
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} "
2327
# =========== PULL LATEST CODE ===========
24-
cd /home/ali/loglife &&
28+
cd /home/ali/loglife-dev &&
2529
git pull &&
2630
2731
# =========== RESTART BACKEND SERVICES ===========
28-
sudo systemctl restart life-bot &&
29-
sudo systemctl restart life-bot-db.service &&
32+
sudo systemctl restart loglife-dev &&
33+
sudo systemctl restart loglife-db-dev.service &&
3034
3135
# =========== DEPLOY WHATSAPP CLIENT ===========
32-
cd /home/ali/loglife/whatsapp-client &&
36+
cd /home/ali/loglife-dev/whatsapp-client &&
3337
npm ci --only=production &&
34-
screen -S loglife -X quit || true &&
35-
screen -S loglife -dm node index.js &&
38+
screen -S loglife-dev -X quit || true &&
39+
screen -S loglife-dev -dm node index.js &&
3640
3741
# =========== BUILD MKDOCS & DEPLOY DOCS ===========
38-
cd /home/ali/loglife &&
42+
cd /home/ali/loglife-dev &&
3943
uv run mkdocs build &&
40-
sudo cp -r /home/ali/loglife/site/* /var/www/docs.loglife.co/ &&
44+
sudo cp -r /home/ali/loglife-dev/site/* /var/www/docs.loglife.co/ &&
4145
sudo systemctl reload nginx
4246
"

src/loglife/app/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020

2121
SQLITE_WEB_URL = (
22-
"http://5.161.234.127:8080/"
22+
"https://test.loglife.co/database/"
2323
if FLASK_ENV == "production"
2424
else "http://127.0.0.1:8080/"
2525
)

0 commit comments

Comments
 (0)