chore(ci): add Gitea Actions deploy workflow for addon auto-deploy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
46
.gitea/workflows/deploy.yml
Normal file
46
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Deploy Addons
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'addon/**'
|
||||
- 'lobby-addon/**'
|
||||
- 'hub-return-addon/**'
|
||||
- 'docker-compose.yml'
|
||||
- 'scripts/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@v1
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
password: ${{ secrets.DEPLOY_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
set -e
|
||||
APP_DIR="$HOME/minecraft-multiworld"
|
||||
|
||||
# First run: clone. Subsequent: pull.
|
||||
if [ ! -d "$APP_DIR/.git" ]; then
|
||||
cd "$APP_DIR"
|
||||
git init
|
||||
git remote add origin https://git.silverlabs.uk/SilverLABS/minecraft-aiworld.git
|
||||
git fetch origin main
|
||||
git checkout -f origin/main -- addon/ lobby-addon/ hub-return-addon/
|
||||
else
|
||||
cd "$APP_DIR"
|
||||
git fetch origin main
|
||||
git checkout -f origin/main -- addon/ lobby-addon/ hub-return-addon/
|
||||
fi
|
||||
|
||||
# Restart all 4 Minecraft containers to pick up changes
|
||||
docker restart mc-lobby mc-jamie mc-lyla mc-mya
|
||||
|
||||
# Wait and verify
|
||||
sleep 10
|
||||
docker ps --filter "name=mc-" --format "{{.Names}}: {{.Status}}"
|
||||
Reference in New Issue
Block a user