diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index 1da23b91..058469c8 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -26,12 +26,17 @@ jobs: git clean -fd git pull git submodule update --init --recursive - - name: Build with embedded UI + - name: Build botui (to embed UI files) run: | - CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver --features embed-ui + cargo build -p botui --bin botui --release + - name: Build botserver with embedded UI + run: | + # Copy botui/ui to botserver/ui so rust-embed can find it + cp -r botui/ui botserver/ui + CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver --features embed-ui --release - name: Deploy to Stage run: | - BINARY=/opt/gbo/work/target/debug/botserver + BINARY=/opt/gbo/work/target/release/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"