2025-03-26 19:46:19 -03:00
|
|
|
name: GBCI
|
2025-03-26 21:29:00 -03:00
|
|
|
run: git config --global http.sslVerify false
|
2025-03-26 19:46:19 -03:00
|
|
|
on:
|
|
|
|
push:
|
2025-03-26 20:34:11 -03:00
|
|
|
branches: [ "main" ]
|
2025-03-26 19:46:19 -03:00
|
|
|
pull_request:
|
2025-03-26 20:34:11 -03:00
|
|
|
branches: [ "main" ]
|
2025-03-26 19:46:19 -03:00
|
|
|
|
|
|
|
jobs:
|
2025-03-26 20:34:11 -03:00
|
|
|
build:
|
2025-03-26 19:50:42 -03:00
|
|
|
runs-on: gbo
|
2025-03-26 20:34:11 -03:00
|
|
|
|
2025-03-26 19:46:19 -03:00
|
|
|
steps:
|
2025-03-26 21:43:49 -03:00
|
|
|
|
2025-03-28 10:24:41 -03:00
|
|
|
- name: Disable SSL verification (temporary)
|
|
|
|
run: git config --global http.sslVerify false
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: '20'
|
|
|
|
cache: 'npm'
|
2025-04-19 01:12:54 -03:00
|
|
|
|
2025-03-28 10:24:41 -03:00
|
|
|
- name: Copy files to deployment location
|
|
|
|
run: |
|
2025-04-19 01:42:51 -03:00
|
|
|
sudo rm -rf /opt/gbo/bin/BotServer/*
|
|
|
|
|
2025-04-19 01:09:16 -03:00
|
|
|
sudo cp -r ./* /opt/gbo/bin/BotServer
|
|
|
|
sudo cp /opt/gbo/conf.d/bot/.env /opt/gbo/bin/BotServer
|
2025-03-28 10:24:41 -03:00
|
|
|
|
|
|
|
- name: Install production dependencies in deployment location
|
|
|
|
run: |
|
|
|
|
echo "[General Bots Deployer] Building BotServer..."
|
|
|
|
cd /opt/gbo/bin/BotServer
|
|
|
|
sudo npm ci --production
|
|
|
|
npm run build --if-present
|
|
|
|
|
|
|
|
echo "[General Bots Deployer] Building default.gbui..."
|
|
|
|
cd /opt/gbo/bin/BotServer/packages/default.gbui
|
|
|
|
npm install
|
|
|
|
npm run build
|
2025-04-18 23:48:26 -03:00
|
|
|
|
2025-03-28 08:39:06 -03:00
|
|
|
- name: Restart Bots Deployer
|
2025-03-28 07:14:35 -03:00
|
|
|
run: |
|
2025-03-28 08:39:06 -03:00
|
|
|
echo "[General Bots Deployer] Restarting..."
|
2025-03-28 09:18:08 -03:00
|
|
|
|
2025-04-19 11:36:07 -03:00
|
|
|
|
2025-04-19 11:48:09 -03:00
|
|
|
timeout 10 sudo systemctl stop botserver
|
|
|
|
timeout 10 sudo systemctl start botserver
|
2025-04-19 11:14:26 -03:00
|
|
|
sudo systemctl status botserver
|
2025-03-28 09:20:12 -03:00
|
|
|
|
2025-04-19 11:14:26 -03:00
|
|
|
echo "[General Bots Deployer] Started."
|