Files
startrail-org--pixelrag/.github/workflows/deploy.yml
T
wehub-resource-sync 542cfa195c
CI / Frontend build (push) Failing after 9m6s
CI / Plugin validate (push) Failing after 9m27s
CI / Python lint (push) Failing after 16m1s
CI / Tests (push) Successful in 18m0s
Deploy / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:33:27 +08:00

42 lines
1.4 KiB
YAML

name: Deploy
# Continuous deployment to the self-hosted box. Triggers ONLY on push to main
# (post-merge = trusted code) and manual dispatch — never on pull_request — so
# fork PRs can't run on the self-hosted runner. The frontend deploys separately
# via Vercel; this handles the agent backend / Python services on the box.
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: [self-hosted, deploy]
steps:
- name: Fast-forward working tree + restart what changed
env:
BEFORE: ${{ github.event.before }}
run: |
set -euo pipefail
cd /home/yichuan/visrag
# Safety: this box is also a dev machine. Only deploy when it's on a
# clean main — never clobber in-progress branch work.
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" != "main" ]; then
echo "::warning::deploy box is on '$branch', not main — skipping (deploy manually when back on main)"
exit 0
fi
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "::warning::deploy box has uncommitted changes — skipping to avoid clobbering"
exit 0
fi
git fetch origin main
git merge --ff-only origin/main
bash deploy/deploy.sh "${BEFORE:-}"