name: BotServer CI on: push: branches: [main] paths: - 'botserver/**' - 'botlib/**' - 'Cargo.lock' - '.forgejo/workflows/botserver.yaml' 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/generalbots git reset --hard HEAD git clean -fd git pull - name: Build run: | cd /opt/gbo/work/generalbots cargo build -p botserver --bin botserver - name: Deploy run: | timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true mkdir -p /opt/gbo/bin cp -f /opt/gbo/work/generalbots/target/debug/botserver /opt/gbo/bin/ chmod +x /opt/gbo/bin/botserver cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2> /opt/gbo/logs/stderr.log & sleep 5 pgrep -x botserver && echo "BotServer Deployed" || echo "Failed"