generalbots/.forgejo/workflows/botserver.yaml
Rodrigo Rodriguez (Pragmatismo) e8ef6c838f
Some checks failed
Botlib CI / build (push) Successful in 5s
BotServer CI / build (push) Failing after 0s
Bottest CI / build (push) Successful in 22s
BotUI CI / build (push) Successful in 13s
fix(ci): use generalbots parent repo for UI sync path
2026-04-23 22:18:05 +00:00

36 lines
1.7 KiB
YAML

name: BotServer CI
on:
push:
branches: [main]
jobs:
build:
runs-on: gbo
env:
CARGO_TARGET_DIR: /opt/gbo/work/target
RUSTC_WRAPPER: ""
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SYSTEM_HOST: ${{ vars.SYSTEM_HOST }}
SYSTEM_USER: gbuser
steps:
- name: Build
run: |
cd /opt/gbo/work/botserver
git reset --hard HEAD && git clean -fd
git pull
git submodule update --init --recursive botlib botserver
cargo build -p botserver
- name: Deploy to Stage
run: |
BINARY=/opt/gbo/work/target/debug/botserver
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo systemctl stop botserver 2>/dev/null; sudo pkill -x botserver 2>/dev/null; sleep 1"
scp -o StrictHostKeyChecking=no "$BINARY" ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botserver-new
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo mv /opt/gbo/bin/botserver-new /opt/gbo/bin/botserver && sudo chmod +x /opt/gbo/bin/botserver && sudo systemctl enable botserver && sudo systemctl start botserver"
sleep 10
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
- name: Sync UI Files to Stage
run: |
cd /opt/gbo/work/generalbots
git reset --hard HEAD && git clean -fd
git pull
git submodule update --init --recursive
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/data/botui/ui/