- Fix all workflows to use /opt/gbo/work/generalbots (monorepo) - Add proper env vars (SCCACHE, CARGO_TARGET_DIR, PATH) to all workflows - Add deploy steps for botui (with process restart) - Remove broken workflows for non-Rust packages (botapp, botbook, botdevice, botmodels, botplugin) - Add botlib test workflow
37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
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"
|