Files
LarsandCursor 0924e28fce
Deploy Development / deploy (push) Failing after 20s
Test Suite / pytest-backend (push) Failing after 35s
Test Suite / smoke-dev (push) Failing after 0s
Test Suite / frontend-build (push) Successful in 7s
Fuehre die Pflicht-Suite nach dem Dev-Deploy gegen tsumugu_test auf der bestehenden Dev-Postgres aus.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 07:21:20 +02:00

58 lines
1.9 KiB
YAML

name: Deploy Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Tsumugu to production
run: |
set -e
echo "=== Deploying Tsumugu to PRODUCTION ==="
REPO="http://192.168.2.144:3000/Lars/tsumugu.git"
TARGET="/home/lars/docker/tsumugu"
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
if [ ! -f .env ]; then
umask 077
PASS="$(od -An -N24 -tx1 /dev/urandom | tr -d ' \n')"
printf '%s\n' \
'DB_NAME=tsumugu' \
'DB_USER=tsumugu' \
"DB_PASSWORD=${PASS}" \
'APP_URL=https://tsumugu.jinkendo.de' \
'ALLOWED_ORIGINS=https://tsumugu.jinkendo.de' \
'TSUMUGU_ENV=production' \
'TSUMUGU_FRONTEND_PORT=3007' \
'TSUMUGU_BACKEND_PORT=8007' \
> .env
unset PASS
echo "created $TARGET/.env (password not logged)"
umask 022
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:8007/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:3007/api/health && echo "PROD frontend proxy /api/health OK"
echo "=== Tsumugu PROD deploy complete ==="