fix(ci): add defaults.working-directory and prepare-workspace to both workflows
This commit is contained in:
parent
3a1e4b9507
commit
ef949885c7
2 changed files with 13 additions and 9 deletions
|
|
@ -2,6 +2,9 @@ name: BotServer CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: /opt/gbo/work/generalbots
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
|
|
@ -18,16 +21,12 @@ jobs:
|
||||||
if [ ! -d /opt/gbo/work/generalbots/.git ]; then
|
if [ ! -d /opt/gbo/work/generalbots/.git ]; then
|
||||||
git clone https://alm.pragmatismo.com.br/GeneralBots/generalbots.git /opt/gbo/work/generalbots
|
git clone https://alm.pragmatismo.com.br/GeneralBots/generalbots.git /opt/gbo/work/generalbots
|
||||||
fi
|
fi
|
||||||
- name: Setup
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/generalbots
|
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git pull
|
git pull
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
|
||||||
CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver
|
CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver
|
||||||
- name: Deploy to Stage
|
- name: Deploy to Stage
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -42,4 +41,4 @@ jobs:
|
||||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "readlink /proc/\$(pgrep -x botserver)/cwd 2>/dev/null || echo 'botserver not running'"
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "readlink /proc/\$(pgrep -x botserver)/cwd 2>/dev/null || echo 'botserver not running'"
|
||||||
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/botui/ui/
|
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/botui/ui/
|
||||||
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botui/ui/
|
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botui/ui/
|
||||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "ls -la /opt/gbo/botui/ui/suite/chat/chat.html /opt/gbo/bin/botui/ui/suite/chat/chat.html 2>/dev/null"
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "wc -c /opt/gbo/botui/ui/suite/chat/chat.html /opt/gbo/bin/botui/ui/suite/chat/chat.html 2>/dev/null"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ name: BotUI CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: /opt/gbo/work/generalbots
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
|
|
@ -12,9 +15,12 @@ jobs:
|
||||||
SYSTEM_HOST: ${{ vars.SYSTEM_HOST }}
|
SYSTEM_HOST: ${{ vars.SYSTEM_HOST }}
|
||||||
SYSTEM_USER: gbuser
|
SYSTEM_USER: gbuser
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Prepare workspace
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
mkdir -p /opt/gbo/work/generalbots /opt/gbo/work/target /opt/gbo/bin
|
||||||
|
if [ ! -d /opt/gbo/work/generalbots/.git ]; then
|
||||||
|
git clone https://alm.pragmatismo.com.br/GeneralBots/generalbots.git /opt/gbo/work/generalbots
|
||||||
|
fi
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git pull
|
git pull
|
||||||
|
|
@ -22,7 +28,6 @@ jobs:
|
||||||
mkdir -p /opt/gbo/bin
|
mkdir -p /opt/gbo/bin
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
|
||||||
CARGO_BUILD_JOBS=4 cargo build -p botui --bin botui
|
CARGO_BUILD_JOBS=4 cargo build -p botui --bin botui
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -36,4 +41,4 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/botui/ui/
|
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/botui/ui/
|
||||||
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botui/ui/
|
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/work/generalbots/botui/ui/ ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botui/ui/
|
||||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "ls -la /opt/gbo/botui/ui/suite/chat/chat.html /opt/gbo/bin/botui/ui/suite/chat/chat.html 2>/dev/null; wc -c /opt/gbo/botui/ui/suite/chat/chat.html /opt/gbo/bin/botui/ui/suite/chat/chat.html 2>/dev/null"
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "wc -c /opt/gbo/botui/ui/suite/chat/chat.html /opt/gbo/bin/botui/ui/suite/chat/chat.html 2>/dev/null"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue