30 lines
1.2 KiB
YAML
30 lines
1.2 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: |
|
|
sudo incus exec system --project STAGE-GBO -- systemctl stop botserver || true
|
|
sudo incus exec system --project STAGE-GBO -- pkill -x botserver || true
|
|
sleep 1
|
|
sudo incus file push /opt/gbo/work/botserver/target/debug/botserver system/opt/gbo/bin/botserver --project STAGE-GBO --mode=0755
|
|
sudo incus exec system --project STAGE-GBO -- systemctl start botserver
|
|
sleep 2
|
|
sudo incus exec system --project STAGE-GBO -- pgrep -x botserver && echo "BotServer Deployed to Stage" || echo "Failed"
|