Files
Dimension-47/.gitea/workflows/deploy.yml
Alexander Zielonka 9c77370b70
All checks were successful
Deploy Dimension47 / deploy (push) Successful in 34s
ci: Ensure CORS_ORIGINS is set in server .env
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:27:08 +01:00

60 lines
1.4 KiB
YAML

name: Deploy Dimension47
on:
push:
branches:
- main
jobs:
deploy:
runs-on: linux-amd64
steps:
- name: Pull latest code
run: |
cd /opt/dimension47
git fetch origin
git reset --hard origin/main
- name: Install Server Dependencies
run: |
cd /opt/dimension47/server
npm ci --production=false
- name: Install Client Dependencies
run: |
cd /opt/dimension47/client
npm ci
- name: Generate Prisma Client
run: |
cd /opt/dimension47/server
npx prisma generate
- name: Run Migrations
run: |
cd /opt/dimension47/server
npx prisma migrate deploy
- name: Build Client
run: |
cd /opt/dimension47/client
echo 'VITE_API_URL=https://dimension47.de/api' > .env
npm run build
- name: Build Server
run: |
cd /opt/dimension47/server
npm run build
- name: Ensure Server Env
run: |
cd /opt/dimension47/server
grep -q "CORS_ORIGINS" .env || echo 'CORS_ORIGINS=https://dimension47.de,http://localhost:5173' >> .env
- name: Restart Server
run: |
pm2 delete dimension47 2>/dev/null || true
cd /opt/dimension47/server
pm2 start dist/src/main.js --name dimension47
pm2 save