Files
tipibot/.gitea/workflows/deploy.yml
Rene Arumetsa 8d16da268d
All checks were successful
Test & Deploy / test (push) Successful in 21s
Test & Deploy / deploy (push) Successful in 7s
Fix eco bot service
2026-07-27 15:52:51 +03:00

36 lines
1.0 KiB
YAML

name: Test & Deploy
on:
push:
branches: [master]
jobs:
test:
runs-on: linux
steps:
- name: Run test suite
run: |
REPO=$(git -C /root/tipibot remote get-url origin)
rm -rf /tmp/tipibot-ci
git clone --quiet "$REPO" /tmp/tipibot-ci
cd /tmp/tipibot-ci
git checkout --quiet ${{ github.sha }}
python3 -m venv /opt/tipibot-ci-venv
/opt/tipibot-ci-venv/bin/pip install -q -r requirements-dev.txt
/opt/tipibot-ci-venv/bin/python -m pytest tests/ -q
deploy:
runs-on: linux
needs: test
steps:
- name: Deploy
run: |
cd /root/tipibot
git pull
source .venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart tipibot_dev # dev bot first, as canary
sleep 5
systemctl is-active --quiet tipibot_dev # dev crashed on startup -> abort
sudo systemctl restart tipibot_eco # eco bot only if dev survived