Add Gitea Actions workflow for auto-deploy to LXC on push
Deploy to LXC / deploy (push) Failing after 6s

SSH-based deploy: git pull, npm ci, build, db:push, systemctl restart.
Secrets configured in Gitea repo settings (DEPLOY_HOST, DEPLOY_USER,
DEPLOY_KEY). Includes setup guide in docs/ci-deploy-setup.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 16:07:12 +07:00
parent fe2217eff7
commit 12a6e9ef0b
2 changed files with 119 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
name: Deploy to LXC
on:
push:
branches: [main]
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 }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT || 22 }}
script: |
set -e
cd ${{ secrets.DEPLOY_PATH || '/home/bflr/buildfor_life_repair' }}
echo "==> Pulling latest code..."
git pull origin main
echo "==> Installing dependencies..."
npm ci --production=false
echo "==> Building..."
npm run build
echo "==> Running migrations..."
npm run db:push
echo "==> Restarting service..."
sudo systemctl restart bflr
echo "==> Waiting for startup..."
sleep 2
systemctl is-active --quiet bflr && echo "Deploy successful!" || (echo "Service failed to start!" && exit 1)