Skip to content

Commit 2b19c69

Browse files
author
Derssen
committed
Add deploy workflow
1 parent ee6e19c commit 2b19c69

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to Server
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Срабатывает при пуше в ветку main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Deploy via SSH
13+
uses: appleboy/ssh-action@master
14+
with:
15+
host: ${{ secrets.HOST }}
16+
username: ${{ secrets.USERNAME }}
17+
key: ${{ secrets.SSH_KEY }}
18+
port: 22
19+
script: |
20+
# 1. Переходим в папку с ботом (УКАЖИ СВОЙ ПУТЬ!)
21+
cd /home/bot/telegram-balance-bot/
22+
23+
# 2. Скачиваем изменения
24+
git pull origin main
25+
26+
# 3. Активируем виртуальное окружение и обновляем библиотеки (если надо)
27+
source venv/bin/activate
28+
pip install -r requirements.txt
29+
30+
# 4. Перезапускаем бота
31+
# Для этого бот должен быть запущен через systemd (см. ниже)
32+
systemctl restart estetico_balance_bot

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ __pycache__/
33
*.sqlite3
44
venv/
55
.DS_Store
6-
.github
76
*.zip

0 commit comments

Comments
 (0)