CI: Single workflow at root

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-19 06:36:04 -03:00
parent a413cbd37e
commit bccd7a24cf
2 changed files with 4 additions and 67 deletions

View file

@ -1,50 +0,0 @@
# v26 - Clean submodule state
name: BotServer CI
on:
push:
branches: [main]
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/botserver
git rebase --abort 2>/dev/null || true
git reset --hard HEAD
git clean -fd
git pull
# CRITICAL: Reset submodules to clean state
git submodule foreach --recursive git reset --hard HEAD 2>/dev/null || true
git submodule foreach --recursive git clean -fd 2>/dev/null || true
git submodule update --init --recursive botlib botserver
# Verify clean
echo "Submodule status:"
git submodule status | head -5
- name: Build
run: |
cd /opt/gbo/work/botserver
cargo build -p botserver
- name: Deploy
run: |
echo "1. Kill old..."
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
echo "2. Copy..."
mkdir -p /opt/gbo/bin
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/
chmod +x /opt/gbo/bin/botserver
echo "3. Start..."
cd /opt/gbo/bin && ./botserver --noconsole &
sleep 3
echo "4. Verify..."
pgrep -x botserver && echo "✅ Running" || echo "❌ Failed"

View file

@ -1,12 +1,9 @@
name: BotServer CI
on:
push:
branches: [main]
env:
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
jobs:
build:
runs-on: gbo
@ -15,30 +12,20 @@ jobs:
run: |
cd /opt/gbo/work/botserver
git rebase --abort 2>/dev/null || true
git reset --hard HEAD && git clean -fd
git pull
git reset --hard HEAD && git clean -fd && git pull
git submodule foreach --recursive git reset --hard HEAD 2>/dev/null || true
git submodule update --init --recursive botlib botserver 2>/dev/null || true
- name: Build
run: |
cd /opt/gbo/work/botserver
cargo build -p botserver
- name: Deploy
run: |
BINARY="/opt/gbo/work/botserver/target/debug/botserver"
echo "1. Stop old on system..."
B="/opt/gbo/work/botserver/target/debug/botserver"
sudo incus exec system -- systemctl stop botserver || true
sudo incus exec system -- pkill -x botserver || true
sleep 1
echo "2. Copy new binary..."
sudo incus file push "$BINARY" system:/opt/gbo/bin/botserver --mode=0755
echo "3. Start new on system..."
sudo incus file push "$B" system:/opt/gbo/bin/botserver --mode=0755
sudo incus exec system -- systemctl start botserver
sleep 2
echo "4. Verify..."
sudo incus exec system -- pgrep -x botserver && echo "✅ SUCCESS" || echo "❌ FAILED"
sudo incus exec system -- pgrep -x botserver && echo "✅ Deployed!" || echo "❌ Failed"