2025-03-26 19:46:19 -03:00
|
|
|
name: GBCI
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2025-03-26 20:29:33 -03:00
|
|
|
branches: ["main"]
|
2025-03-26 19:46:19 -03:00
|
|
|
pull_request:
|
2025-03-26 20:29:33 -03:00
|
|
|
branches: ["main"]
|
2025-03-26 19:46:19 -03:00
|
|
|
|
|
|
|
|
jobs:
|
2025-03-26 20:29:33 -03:00
|
|
|
build-and-deploy:
|
2025-03-26 19:50:42 -03:00
|
|
|
runs-on: gbo
|
2025-03-26 19:46:19 -03:00
|
|
|
steps:
|
2025-03-26 20:29:33 -03:00
|
|
|
- name: Disable SSL verification (temporary)
|
|
|
|
|
run: git config --global http.sslVerify false
|
|
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
2025-03-26 19:46:19 -03:00
|
|
|
- name: Setup Node.js
|
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
|
with:
|
2025-03-26 20:29:33 -03:00
|
|
|
node-version: '20'
|
|
|
|
|
cache: 'npm'
|
2025-03-26 19:46:19 -03:00
|
|
|
|
2025-03-26 20:29:33 -03:00
|
|
|
- name: Install TypeScript and compile
|
|
|
|
|
run: |
|
|
|
|
|
|
|
|
|
|
/opt/gbo/bin/BotServer/node_modules/.bin/tsc -p .
|
|
|
|
|
|
|
|
|
|
- name: Copy files to deployment location
|
|
|
|
|
run: |
|
|
|
|
|
sudo cp ./* /opt/gbo/bin/BotServer/
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
|
cd /opt/gbo/bin/BotServer/default.gbui
|
|
|
|
|
npm config set scripts-prepend-node-path true
|
|
|
|
|
echo "[General Bots Deployer] Building default.gbui..."
|
|
|
|
|
npm install
|
|
|
|
|
npm run build
|
|
|
|
|
|
|
|
|
|
cd ../..
|
|
|
|
|
rm -rf deploy/default.gbui/node_modules
|
|
|
|
|
|
|
|
|
|
- name: Transpile TypeScript
|
|
|
|
|
run: |
|
|
|
|
|
echo "[General Bots Deployer] Transpiling..."
|
|
|
|
|
cd /opt/gbo/bin/BotServer
|
|
|
|
|
npx tsc -v
|
|
|
|
|
npx tsc -p .
|
|
|
|
|
echo "[General Bots Deployer] Deployment Finished."
|
|
|
|
|
|
|
|
|
|
- name: Reload and enable service
|
|
|
|
|
run: |
|
|
|
|
|
npm run start &
|