init: scaffold complet Sakuin — backend NestJS + frontend SvelteKit + CI/CD + deploy VPS
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 29s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 29s
Backend: 5 modules (auth, user, work, list, health), AniList GraphQL proxy, SuperOAuth PKCE introspection, XP system, migrations TypeORM. Frontend: SvelteKit adapter-node, PWA manifest, dark theme, pages home/search/list/profile/callback. Infra: CI/CD Gitea vps-runner, Apache vhost SSL, pm2 sakuin-backend + sakuin-frontend, port 4002. License: BSL 1.1 (Apache 2.0 en 2028).
This commit is contained in:
60
.gitea/workflows/deploy.yml
Normal file
60
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
name: CI/CD — Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
name: Build & Deploy
|
||||
runs-on: vps-runner
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# ── Backend ──────────────────────────────────────────────────────────────
|
||||
- name: Install & build backend
|
||||
working-directory: backend
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Deploy backend
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
mkdir -p /var/www/sakuin/backend
|
||||
rsync -a --delete backend/dist/ /var/www/sakuin/backend/dist/
|
||||
rsync -a backend/package.json backend/package-lock.json /var/www/sakuin/backend/
|
||||
cd /var/www/sakuin/backend && npm ci --omit=dev
|
||||
|
||||
- name: Restart pm2
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
su - tetardtek-brain -c 'pm2 reload sakuin-backend --update-env'
|
||||
|
||||
# ── Frontend ─────────────────────────────────────────────────────────────
|
||||
- name: Install & build frontend
|
||||
working-directory: frontend
|
||||
env:
|
||||
VITE_API_URL: https://sakuin.tetardtek.com/api
|
||||
VITE_OAUTH_URL: https://superoauth.tetardtek.com
|
||||
VITE_OAUTH_CLIENT_ID: sakuin
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Deploy frontend
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
mkdir -p /var/www/sakuin/frontend/build
|
||||
rsync -a --delete frontend/build/ /var/www/sakuin/frontend/build/
|
||||
|
||||
# ── Smoke test ───────────────────────────────────────────────────────────
|
||||
- name: Smoke test API
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
sleep 3
|
||||
curl -sf http://localhost:4002/api/health | grep -q '"ok"'
|
||||
echo "✅ API health OK"
|
||||
Reference in New Issue
Block a user