Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/deploy-selfhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,37 @@ jobs:
- name: Checkout latest code
uses: actions/checkout@v4

- name: Setup Python environment
run: |
VENV_DIR="/opt/prod-Alya-Bot-Telegram/venv"
if [ -d "$VENV_DIR" ]; then
VER=$($VENV_DIR/bin/python --version 2>&1)
if [[ "$VER" != *"3.10"* ]]; then
echo "Version mismatch ($VER). Rebuilding venv for Python 3.10..."
sudo rm -rf "$VENV_DIR"
fi
fi

if [ ! -d "$VENV_DIR" ]; then
python3.10 -m venv "$VENV_DIR"
fi

- name: Prepare and update codebase
run: |
cd /opt/prod-Alya-Bot-Telegram
git stash --include-untracked || true
git checkout master
git pull origin master

- name: Install Python dependencies
run: |
cd /opt/prod-Alya-Bot-Telegram
source venv/bin/activate
python -m pip install "pip<24.1"
pip uninstall -y omegaconf || true
pip install -r requirements.txt
echo "Dependencies installed successfully"

- name: Restart AlyaBot via systemd
run: |
sudo systemctl restart prod-alya-bot.service
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libjpeg62-turbo \
ffmpeg \
libmagic1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down
Loading