CI: Gitea Actions Workflow - Build, Typecheck, Deploy und Health-Check bei Push auf main
Build & Deploy / deploy (push) Failing after 17s
Build & Deploy / deploy (push) Failing after 17s
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
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"
|
||||||
Reference in New Issue
Block a user