fix(ci): deploy botui static assets and implement cache busting
Some checks failed
BotServer CI / build (push) Failing after 16s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-02-20 20:36:30 -03:00
parent ce81951a69
commit ec8d002574

View file

@ -28,6 +28,7 @@ jobs:
git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git workspace git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git workspace
cd workspace cd workspace
git submodule update --init --depth 1 botlib git submodule update --init --depth 1 botlib
git submodule update --init --depth 1 botui
# Remove all members except botserver and botlib from workspace # Remove all members except botserver and botlib from workspace
sed -i '/"botapp",/d' Cargo.toml sed -i '/"botapp",/d' Cargo.toml
@ -43,8 +44,14 @@ jobs:
rm -rf workspace/botserver rm -rf workspace/botserver
mv botserver workspace/botserver mv botserver workspace/botserver
- name: Cache Busting
run: |
TS=$(date +%s)
cd workspace/botui/ui/suite/chat
mv chat.css chat.$TS.css
mv chat.js chat.$TS.js
sed -i "s/chat.css/chat.$TS.css/g" chat.html
sed -i "s/chat.js/chat.$TS.js/g" chat.html
- name: Install system dependencies - name: Install system dependencies
run: | run: |
@ -65,7 +72,6 @@ jobs:
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
$HOME/.cargo/bin/sccache --start-server || true $HOME/.cargo/bin/sccache --start-server || true
- name: Setup environment - name: Setup environment
run: sudo cp /opt/gbo/bin/system/.env . 2>/dev/null || true run: sudo cp /opt/gbo/bin/system/.env . 2>/dev/null || true
@ -87,8 +93,14 @@ jobs:
run: | run: |
lxc exec bot:pragmatismo-system -- systemctl stop system || true lxc exec bot:pragmatismo-system -- systemctl stop system || true
# Deploy Binary
sudo cp target/debug/botserver /opt/gbo/bin/system/ sudo cp target/debug/botserver /opt/gbo/bin/system/
sudo chmod +x /opt/gbo/bin/system/botserver sudo chmod +x /opt/gbo/bin/system/botserver
# Deploy UI Assets (botui)
sudo mkdir -p /opt/gbo/bin/system/botui/ui
sudo cp -r botui/ui/suite /opt/gbo/bin/system/botui/ui/
sudo cp -r botui/ui/themes /opt/gbo/bin/system/botui/ui/ || true
lxc exec bot:pragmatismo-system -- systemctl start system || true lxc exec bot:pragmatismo-system -- systemctl start system || true