Kansho/.gitea/workflows/deploy-prod.yml
Lars 07479f6a9f
Some checks failed
Deploy Development / deploy (push) Successful in 44s
Test Suite / backend-sqlite (push) Failing after 2s
Test Suite / frontend-build (push) Successful in 23s
Add Compose, Gitea deploy, and Postgres dual-backend on develop.
Use host ports 3006/8005 and 3096/8096 so Kansho does not collide with Bookstack on 3005 or the sister products.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 12:15:08 +02:00

41 lines
1.3 KiB
YAML

name: Deploy Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Kanshō to production
run: |
set -e
echo "=== Deploying Kanshō to PRODUCTION ==="
REPO="http://192.168.2.144:3000/Lars/Kansho.git"
TARGET="/home/lars/docker/kansho"
mkdir -p "$TARGET"
cd "$TARGET"
if [ ! -d .git ]; then
git clone -b main "$REPO" .
else
git fetch origin main
git checkout main
git reset --hard origin/main
fi
docker compose build --no-cache backend frontend
if ! docker compose up -d --wait; then
echo "compose up --wait failed — backend logs:"
docker compose logs backend --tail 150 || true
docker compose ps || true
exit 1
fi
if ! curl -sf http://localhost:8005/api/health; then
echo "PROD API not reachable — backend logs:"
docker compose logs backend --tail 150 || true
exit 1
fi
echo "PROD API /api/health OK"
curl -sf http://localhost:3006/api/health && echo "PROD frontend proxy /api/health OK"
echo "=== Kanshō PROD deploy complete ==="