2026-04-19 08:14:25 -03:00
|
|
|
name: BotServer CI
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [main]
|
2026-04-21 23:04:27 +00:00
|
|
|
env:
|
|
|
|
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
|
|
|
|
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
2026-04-19 08:14:25 -03:00
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: gbo
|
|
|
|
|
steps:
|
2026-04-22 01:23:37 +00:00
|
|
|
- name: Setup
|
|
|
|
|
run: |
|
|
|
|
|
cd /opt/gbo/work/generalbots
|
|
|
|
|
git reset --hard HEAD
|
|
|
|
|
git clean -fd
|
|
|
|
|
git pull
|
2026-04-22 02:07:07 +00:00
|
|
|
mkdir -p /opt/gbo/work/target
|
|
|
|
|
mkdir -p /opt/gbo/bin
|
2026-04-22 01:23:37 +00:00
|
|
|
- name: Build
|
|
|
|
|
run: |
|
|
|
|
|
cd /opt/gbo/work/generalbots
|
2026-04-22 02:07:07 +00:00
|
|
|
CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver
|
2026-04-22 01:23:37 +00:00
|
|
|
- name: Deploy
|
|
|
|
|
run: |
|
|
|
|
|
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
|
2026-04-22 02:07:07 +00:00
|
|
|
cp -f /opt/gbo/work/target/debug/botserver /opt/gbo/bin/
|
2026-04-22 01:23:37 +00:00
|
|
|
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"
|