CI: New fresh workflow file
This commit is contained in:
parent
3f5e8eee1c
commit
72e64ce7b4
1 changed files with 34 additions and 0 deletions
34
.forgejo/workflows/ci.yaml
Normal file
34
.forgejo/workflows/ci.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# NEW WORKFLOW - Fresh start
|
||||
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:
|
||||
deploy:
|
||||
runs-on: gbo
|
||||
steps:
|
||||
- name: Deploy
|
||||
run: |
|
||||
echo "Starting deploy..."
|
||||
# Kill old
|
||||
timeout 3 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.3; done' || true
|
||||
sleep 1
|
||||
# Copy
|
||||
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/botserver 2>/dev/null || echo "Binary not found, skipping copy"
|
||||
chmod +x /opt/gbo/bin/botserver
|
||||
# Start
|
||||
cd /opt/gbo/bin && ./botserver --noconsole &
|
||||
sleep 2
|
||||
# Verify
|
||||
if pgrep -x botserver > /dev/null 2>&1; then
|
||||
echo "✅ SUCCESS"
|
||||
pgrep -x botserver
|
||||
else
|
||||
echo "❌ FAILED"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue