2026-04-18 20:39:56 -03:00
|
|
|
# v22 - Fast deploy
|
|
|
|
|
name: BotServer CI
|
2025-12-16 13:25:26 -03:00
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2026-04-18 16:33:51 -03:00
|
|
|
branches: [main]
|
2025-12-16 13:25:26 -03:00
|
|
|
|
2026-04-18 16:20:38 -03:00
|
|
|
env:
|
2026-04-18 17:27:23 -03:00
|
|
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
|
|
|
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
2026-04-18 18:26:36 -03:00
|
|
|
RUSTC_WRAPPER: sccache
|
2026-04-18 18:50:22 -03:00
|
|
|
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
2026-04-18 16:20:38 -03:00
|
|
|
|
2025-12-16 13:25:26 -03:00
|
|
|
jobs:
|
|
|
|
|
build:
|
2026-04-18 16:20:38 -03:00
|
|
|
runs-on: gbo
|
2025-12-16 13:25:26 -03:00
|
|
|
steps:
|
2026-04-18 20:39:56 -03:00
|
|
|
- name: Setup
|
2026-04-18 18:26:36 -03:00
|
|
|
run: |
|
2026-04-18 18:50:22 -03:00
|
|
|
cd /opt/gbo/work/botserver
|
2026-04-18 19:13:27 -03:00
|
|
|
git rebase --abort 2>/dev/null || true
|
2026-04-18 20:39:56 -03:00
|
|
|
git reset --hard HEAD && git clean -fd
|
|
|
|
|
git pull && git submodule update --init --recursive botlib botserver
|
2026-04-18 18:50:22 -03:00
|
|
|
rm -rf .github
|
2026-04-18 18:03:31 -03:00
|
|
|
|
2026-04-18 20:39:56 -03:00
|
|
|
- name: Build
|
2026-04-18 18:26:36 -03:00
|
|
|
run: |
|
2026-04-18 18:50:22 -03:00
|
|
|
cd /opt/gbo/work/botserver
|
2026-04-18 18:26:36 -03:00
|
|
|
cargo build -p botserver
|
|
|
|
|
ls -lh target/debug/botserver
|
2026-04-18 18:03:31 -03:00
|
|
|
|
2026-04-18 20:39:56 -03:00
|
|
|
- name: Deploy
|
2026-04-18 18:26:36 -03:00
|
|
|
run: |
|
2026-04-18 20:39:56 -03:00
|
|
|
B="/opt/gbo/work/botserver/target/debug/botserver"
|
|
|
|
|
[ -f "$B" ] && sudo incus file push "$B" system:/opt/gbo/bin/botserver --mode=0755 && sudo incus exec system -- systemctl restart botserver && echo "✅ Deployed" || echo "❌ Failed"
|