43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Build & Deploy
|
||
|
||
# Fährt automatisch bei jedem Push auf main aus:
|
||
# Abhängigkeiten → Typecheck → Build → Deploy auf mieterportal.hocks.eu → Health-Check.
|
||
# Die Anleitungsseiten (src/pages/Anleitung.tsx, src/data/anleitung.ts) werden
|
||
# mit jedem Deploy automatisch aktualisiert, weil sie Teil des Builds sind.
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
|
||
jobs:
|
||
deploy:
|
||
runs-on: docker
|
||
container:
|
||
image: node:22-alpine
|
||
# /opt/mieterportal des Hosts steht im Job als /mp bereit (Whitelist im Runner)
|
||
options: -v /opt/mieterportal:/mp
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Abhängigkeiten installieren
|
||
run: npm ci
|
||
|
||
- name: Typecheck
|
||
run: npx tsc --noEmit
|
||
|
||
- name: Build
|
||
run: npm run build
|
||
|
||
- name: Deploy auf mieterportal.hocks.eu
|
||
run: |
|
||
rm -rf /mp/dist/*
|
||
cp -a dist/. /mp/dist/
|
||
|
||
- name: Health-Check
|
||
run: |
|
||
apk add --no-cache curl
|
||
sleep 3
|
||
curl -sf https://mieterportal.hocks.eu/ > /dev/null
|
||
echo "Portal antwortet – Deploy erfolgreich"
|