Files
buildfor_life_repair/.gitea/workflows/deploy.yml
T
grabowski 12a6e9ef0b
Deploy to LXC / deploy (push) Failing after 6s
Add Gitea Actions workflow for auto-deploy to LXC on push
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>
2026-04-07 16:07:12 +07:00

41 lines
1.0 KiB
YAML

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)