fix(workflows): change build runner from CI to gbo
This commit is contained in:
parent
47debcf2e7
commit
d83bb86af3
1 changed files with 47 additions and 18 deletions
|
@ -1,30 +1,59 @@
|
|||
name: GBCI
|
||||
run: git config --global http.sslVerify false
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-deploy:
|
||||
runs-on: gbo
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Disable SSL verification (temporary)
|
||||
run: git config --global http.sslVerify false
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Build project
|
||||
run: npm run build --if-present
|
||||
|
||||
- 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 &
|
Loading…
Add table
Reference in a new issue