Add Gitea Actions workflow for auto-deploy to LXC on push
Deploy to LXC / deploy (push) Failing after 6s
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:
@@ -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)
|
||||
Reference in New Issue
Block a user