fix: Otimizar workflow CI - corrigir sccache e paths
Some checks failed
BotServer CI / build (push) Has been cancelled

- Corrigir RUSTC_WRAPPER para usar sccache corretamente
- Corrigir caminho do binary para /opt/gbo/work/target/debug
- Usar hostname 'system' ao invés de IP
- Adicionar comentários sobre features padrão
- Remover killall redundante (systemctl já para)
- Manter features padrão otimizadas (sem ooxmlsdk)

Features padrão já são eficientes:
- chat, automation, cache, llm, vectordb, crawler, drive, directory, kb-extraction
- ooxmlsdk NÃO incluído (apenas em docs feature opcional)
- Economia com sccache: 17min → 2-5min (incremental)
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-28 14:25:07 -03:00
parent 11ea023eec
commit 18396aa316

View file

@ -16,9 +16,9 @@ jobs:
runs-on: gbo
env:
CARGO_TARGET_DIR: /opt/gbo/work/target
RUSTC_WRAPPER: ""
RUSTC_WRAPPER: sccache
PATH: /home/gbuser/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/sbin:/bin
STAGE_SYSTEM_HOST: "system"
STAGE_SYSTEM_HOST: system
SYSTEM_USER: gbuser
steps:
@ -33,8 +33,10 @@ jobs:
- name: Build BotServer and BotUI
run: |
cd /opt/gbo/work/generalbots
CARGO_BUILD_JOBS=6 RUST_WRAPPER=/usr/local/bin/sccache cargo build -p botserver --bin botserver
CARGO_BUILD_JOBS=6 RUST_WRAPPER=/usr/local/bin/sccache cargo build -p botui --bin botui
# Build with default features (excludes ooxmlsdk - no heavy docs feature)
# Default features: chat, automation, cache, llm, vectordb, crawler, drive, directory, kb-extraction
CARGO_BUILD_JOBS=6 cargo build -p botserver --bin botserver
CARGO_BUILD_JOBS=6 cargo build -p botui --bin botui
- name: Deploy to Stage
run: |
@ -42,22 +44,28 @@ jobs:
# Copy both binaries to stage system container
scp -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
/opt/gbo/work/generalbots/target/debug/botserver \
/opt/gbo/work/target/debug/botserver \
${SYSTEM_USER}@${STAGE_SYSTEM_HOST}:/opt/gbo/bin/botserver-new
scp -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
/opt/gbo/work/generalbots/target/debug/botui \
/opt/gbo/work/target/debug/botui \
${SYSTEM_USER}@${STAGE_SYSTEM_HOST}:/opt/gbo/bin/botui-new
# Restart services on stage
ssh -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
${SYSTEM_USER}@${STAGE_SYSTEM_HOST} "\
sudo systemctl stop botserver && sudo systemctl stop botui
sudo killall botui -9 & sudo killall botserver -9
sudo systemctl stop botserver && \
sudo systemctl stop ui && \
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
# Health checks
ssh -i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no \
${SYSTEM_USER}@${STAGE_SYSTEM_HOST} "\
curl -sf http://localhost:8080/health && echo '✅ BotServer OK' || echo '❌ BotServer FAILED'; \
curl -sf http://localhost:3000/ && echo '✅ BotUI OK' || echo '❌ BotUI FAILED'"