diff --git a/.forgejo/workflows/botapp.yaml b/.forgejo/workflows/botapp.yaml new file mode 100644 index 0000000..1116194 --- /dev/null +++ b/.forgejo/workflows/botapp.yaml @@ -0,0 +1,16 @@ +name: Botapp CI +on: + push: + branches: [main] + paths: + - 'botapp/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/botapp + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/botbook.yaml b/.forgejo/workflows/botbook.yaml new file mode 100644 index 0000000..cddfea4 --- /dev/null +++ b/.forgejo/workflows/botbook.yaml @@ -0,0 +1,16 @@ +name: Botbook CI +on: + push: + branches: [main] + paths: + - 'botbook/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/botbook + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/botdevice.yaml b/.forgejo/workflows/botdevice.yaml new file mode 100644 index 0000000..41e5418 --- /dev/null +++ b/.forgejo/workflows/botdevice.yaml @@ -0,0 +1,16 @@ +name: Botdevice CI +on: + push: + branches: [main] + paths: + - 'botdevice/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/botdevice + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/botmodels.yaml b/.forgejo/workflows/botmodels.yaml new file mode 100644 index 0000000..7e0dc5a --- /dev/null +++ b/.forgejo/workflows/botmodels.yaml @@ -0,0 +1,16 @@ +name: Botmodels CI +on: + push: + branches: [main] + paths: + - 'botmodels/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/botmodels + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/botplugin.yaml b/.forgejo/workflows/botplugin.yaml new file mode 100644 index 0000000..d1e2dc3 --- /dev/null +++ b/.forgejo/workflows/botplugin.yaml @@ -0,0 +1,16 @@ +name: Botplugin CI +on: + push: + branches: [main] + paths: + - 'botplugin/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/botplugin + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/bottest.yaml b/.forgejo/workflows/bottest.yaml new file mode 100644 index 0000000..c172dfc --- /dev/null +++ b/.forgejo/workflows/bottest.yaml @@ -0,0 +1,16 @@ +name: Bottest CI +on: + push: + branches: [main] + paths: + - 'bottest/**' +jobs: + build: + runs-on: gbo + steps: + - name: Build + run: | + cd /opt/gbo/work/bottest + git reset --hard HEAD && git clean -fd + git pull + cargo build diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml deleted file mode 100644 index 54771ba..0000000 --- a/.forgejo/workflows/ci.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: BotServer CI -on: - push: - branches: [main] -env: - PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -jobs: - build: - runs-on: system # Run on system container instead of alm-ci - steps: - - name: Setup - run: | - cd /opt/gbo/work/botserver - git rebase --abort 2>/dev/null || true - git reset --hard HEAD && git clean -fd && git pull - git submodule foreach --recursive git reset --hard HEAD 2>/dev/null || true - git submodule update --init --recursive botlib botserver 2>/dev/null || true - - name: Build - run: | - cd /opt/gbo/work/botserver - cargo build -p botserver - - name: Deploy - run: | - echo "Stop..." - systemctl stop botserver || true - pkill -x botserver || true - sleep 1 - echo "Copy..." - cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/botserver - chmod +x /opt/gbo/bin/botserver - echo "Start..." - systemctl start botserver - sleep 2 - pgrep -x botserver && echo "✅ Deployed!" || echo "❌ Failed"