generalbots/.forgejo/workflows/botserver-v2.yaml
Rodrigo Rodriguez (Pragmatismo) c218556a94
Some checks are pending
BotServer CI / build (push) Waiting to run
CI: v25 - Fixed pkill with timeout, proper paths
2026-04-18 20:44:04 -03:00

52 lines
1.4 KiB
YAML

# v25 - Deploy: fixed pkill, correct paths
name: BotServer CI
on:
push:
branches: [main]
env:
SCCACHE_DIR: /opt/gbo/work/.sccache
CARGO_TARGET_DIR: /opt/gbo/work/target
RUSTC_WRAPPER: sccache
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
jobs:
build:
runs-on: gbo
steps:
- name: Setup
run: |
cd /opt/gbo/work/botserver
git rebase --abort 2>/dev/null || true
git reset --hard HEAD && git clean -fd
git pull && git submodule update --init --recursive botlib botserver
- name: Build
run: |
cd /opt/gbo/work/botserver
cargo build -p botserver
ls -lh target/debug/botserver
- name: Deploy
run: |
echo "1. Kill old..."
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
echo "2. Copy binary..."
mkdir -p /opt/gbo/bin
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/
chmod +x /opt/gbo/bin/botserver
echo "3. Start new..."
cd /opt/gbo/bin
./botserver --noconsole &
sleep 3
echo "4. Verify..."
if pgrep -x botserver > /dev/null 2>&1; then
echo "✅ Running: $(pgrep -x botserver)"
else
echo "❌ Not running"
exit 1
fi