Skip to content

Commit 9fc1676

Browse files
author
Derssen
committed
Add deploy workflow
1 parent a82b363 commit 9fc1676

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
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/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 balance-bot

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
aiogram>=3.0.0
2+
sqlalchemy>=2.0.0
3+
aiohttp
4+
python-dotenv
5+
aiosqlite
6+
pytz

0 commit comments

Comments
 (0)