Files
Winz 99d4f6dd22
All checks were successful
CI / Build and Deploy (push) Successful in 2m15s
fix ci
2026-05-05 22:40:53 +02:00

67 lines
1.5 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build-deploy:
name: Build and Deploy
runs-on: ubuntu
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show environment
run: |
whoami
hostname
pwd
node -v
npm -v
- name: Deploy source to target directory
if: gitea.event_name == 'push'
run: |
rsync -av --delete \
--exclude ".git" \
--exclude ".github" \
--exclude ".env" \
--exclude "node_modules" \
--exclude ".next" \
./ /opt/RFP_Finanzen/
- name: Install dependencies
if: gitea.event_name == 'push'
run: |
cd /opt/RFP_Finanzen
rm -rf node_modules .next
npm install
- name: Build app
if: gitea.event_name == 'push'
run: |
cd /opt/RFP_Finanzen
npx prisma generate
npx prisma migrate deploy
npm run build
- name: Restart service
if: gitea.event_name == 'push'
run: sudo systemctl restart finanzen-app
- name: Show service status
if: gitea.event_name == 'push'
run: sudo systemctl --no-pager --full status finanzen-app
- name: Test local app endpoint
if: gitea.event_name == 'push'
run: |
sleep 3
curl -I http://127.0.0.1:3000