2026-04-19 08:14:25 -03:00
|
|
|
name: BotServer CI
|
2026-04-28 12:16:25 -03:00
|
|
|
|
2026-04-19 08:14:25 -03:00
|
|
|
on:
|
2026-04-28 18:25:00 -03:00
|
|
|
push:
|
|
|
|
|
branches: [main]
|
|
|
|
|
paths:
|
|
|
|
|
- "botserver/**"
|
|
|
|
|
- "botui/**"
|
|
|
|
|
- "botlib/**"
|
|
|
|
|
- ".forgejo/workflows/botserver.yaml"
|
|
|
|
|
- "Cargo.toml"
|
|
|
|
|
- "Cargo.lock"
|
2026-04-28 12:16:25 -03:00
|
|
|
|
2026-04-19 08:14:25 -03:00
|
|
|
jobs:
|
2026-04-28 18:25:00 -03:00
|
|
|
build:
|
|
|
|
|
runs-on: gbo
|
|
|
|
|
env:
|
|
|
|
|
RUSTC_WRAPPER: sccache
|
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
|
PATH: /home/gbuser/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/sbin:/bin
|
|
|
|
|
steps:
|
|
|
|
|
- name: Setup
|
|
|
|
|
run: |
|
|
|
|
|
cd /opt/gbo/work/generalbots
|
|
|
|
|
git pull
|
2026-04-28 20:06:46 -03:00
|
|
|
git ls-files -z | xargs -0 touch -d "@$(git log -1 --format='%ct')"
|
2026-04-28 18:25:00 -03:00
|
|
|
git log --oneline -1
|
2026-04-28 18:13:02 -03:00
|
|
|
|
2026-04-28 18:25:00 -03:00
|
|
|
- name: Build BotServer and BotUI
|
|
|
|
|
run: |
|
|
|
|
|
cd /opt/gbo/work/generalbots
|
|
|
|
|
rustup default stable
|
|
|
|
|
export RUSTC_WRAPPER=sccache
|
|
|
|
|
echo "=== sccache stats before build ==="
|
|
|
|
|
sccache --show-stats 2>/dev/null || echo "sccache not available"
|
2026-04-28 19:21:38 -03:00
|
|
|
CARGO_BUILD_JOBS=6 cargo build -p botserver --bin botserver
|
|
|
|
|
CARGO_BUILD_JOBS=6 cargo build -p botui --bin botui --release
|
2026-04-28 18:25:00 -03:00
|
|
|
echo "=== sccache stats after build ==="
|
|
|
|
|
sccache --show-stats 2>/dev/null || echo "sccache not available"
|
2026-04-28 18:13:02 -03:00
|
|
|
|
2026-04-28 18:25:00 -03:00
|
|
|
- name: Deploy to Stage
|
|
|
|
|
run: |
|
2026-04-28 18:53:14 -03:00
|
|
|
echo "=== Deploying to Stage ==="
|
2026-04-28 18:25:00 -03:00
|
|
|
scp -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
|
2026-04-28 18:53:14 -03:00
|
|
|
/opt/gbo/work/generalbots/target/debug/botserver \
|
|
|
|
|
gbuser@system:/opt/gbo/bin/botserver-new
|
2026-04-28 18:25:00 -03:00
|
|
|
scp -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
|
2026-04-28 19:04:01 -03:00
|
|
|
/opt/gbo/work/generalbots/target/release/botui \
|
2026-04-28 18:53:14 -03:00
|
|
|
gbuser@system:/opt/gbo/bin/botui-new
|
2026-04-28 18:25:00 -03:00
|
|
|
ssh -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
|
2026-04-28 18:53:14 -03:00
|
|
|
gbuser@system \
|
2026-04-28 18:25:00 -03:00
|
|
|
"sudo systemctl stop botserver || true && \
|
|
|
|
|
sudo systemctl stop ui || true && \
|
|
|
|
|
sudo mv /opt/gbo/bin/botserver-new /opt/gbo/bin/botserver && \
|
|
|
|
|
sudo mv /opt/gbo/bin/botui-new /opt/gbo/bin/botui && \
|
|
|
|
|
sudo chmod +x /opt/gbo/bin/botserver /opt/gbo/bin/botui && \
|
|
|
|
|
sudo systemctl start botserver && \
|
|
|
|
|
sudo systemctl start ui"
|
|
|
|
|
sleep 10
|
|
|
|
|
ssh -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
|
2026-04-28 18:53:14 -03:00
|
|
|
gbuser@system \
|
2026-04-28 22:05:23 -03:00
|
|
|
"curl -sf http://localhost:5858/api/health && echo 'BotServer OK' || echo 'BotServer FAILED'; \
|
2026-04-28 18:25:00 -03:00
|
|
|
curl -sf http://localhost:3000/ && echo 'BotUI OK' || echo 'BotUI FAILED'"
|