generalbots/.forgejo/workflows/botserver-v2.yaml
Rodrigo Rodriguez (Pragmatismo) 6f003a313c
Some checks failed
BotServer CI / build (push) Has been cancelled
CI: v24 - Deploy with traces and verification
2026-04-18 20:43:06 -03:00

55 lines
1.5 KiB
YAML

# v24 - Deploy with traces
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
- name: Deploy
run: |
echo "Deploy step 1/4: Stopping..."
sudo pkill -f botserver || true
sleep 1
echo "Deploy step 2/4: Copying..."
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/botserver
chmod +x /opt/gbo/bin/botserver
echo "Deploy step 3/4: Starting..."
cd /opt/gbo/bin
nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2>&1 &
BOT_PID=$!
echo "Started PID: $BOT_PID"
echo "Deploy step 4/4: Verifying..."
sleep 3
if pgrep -f botserver > /dev/null; then
echo "✅ Success - botserver running"
pgrep -f botserver
else
echo "❌ Failed - botserver not running"
cat /opt/gbo/logs/stdout.log | tail -10
exit 1
fi