Files
tsumugu/.gitea/workflows/deploy-prod.yml
T
LarsandCursor 353001d819
Deploy Development / deploy (push) Successful in 17s
Deploy Production / deploy (push) Successful in 16s
Lege Tsumugu auf freie Pi-Ports 3007/8007 und 3094/8094.
8006 und 8095 sind bereits durch BuyingAgent belegt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-15 09:47:10 +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 ==="