This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# Deploy-Pipeline
|
||||
|
||||
## Überblick
|
||||
|
||||
Bei jedem **Push auf `main`** in git.hocks.eu (ah-admin/Mieterportal) läuft
|
||||
automatisch die Pipeline **„Build & Deploy"** (sichtbar unter
|
||||
`https://git.hocks.eu/ah-admin/Mieterportal/actions`):
|
||||
|
||||
1. **Checkout** – Quellstand des Pushes
|
||||
2. **Abhängigkeiten installieren** – `npm ci`
|
||||
3. **Typecheck** – `tsc --noEmit` (bricht den Deploy bei Typfehlern ab)
|
||||
4. **Anleitungs-Stand aktualisieren** – `anleitung-meta.mjs` schreibt Hash/Datum
|
||||
in die Anleitungsseite (Hash aus `GITHUB_SHA`, da im Job-Container kein `.git` liegt)
|
||||
5. **Build** – `npm run build`
|
||||
6. **Deploy** – Inhalt von `dist/` wird nach `/opt/mieterportal/dist` kopiert
|
||||
(Bind-Mount des `mp-portal`-nginx-Containers; **Dateien kopieren, nie `mv`**,
|
||||
sonst folgt der Mount dem alten Inode)
|
||||
7. **Health-Check** – `https://mieterportal.hocks.eu/` muss antworten,
|
||||
sonst schlägt der Lauf fehl
|
||||
|
||||
Die Anleitungsseiten (Mieter + Verwaltung) sind Teil des Builds und werden damit
|
||||
**mit jedem Deploy automatisch auf den aktuellen Stand gebracht**.
|
||||
|
||||
## Infrastruktur auf dem VPS (hocks.eu)
|
||||
|
||||
- **Gitea** (Container `gitea`) – hostet das Repo, stellt die Actions-API bereit
|
||||
- **act-runner** (Container `act-runner`, Compose: `/opt/act-runner/docker-compose.yml`,
|
||||
Config: `/opt/act-runner/config.yaml`) – registriert als `hocks-vps-runner`,
|
||||
führt Jobs in `node:22-alpine`-Containern aus
|
||||
- **Volume-Whitelist:** Der Job-Container mountet `/opt/mieterportal` als `/mp`
|
||||
(Eintrag `container.valid_volumes` im Runner; im Workflow als
|
||||
`options: -v /opt/mieterportal:/mp`)
|
||||
|
||||
## Manueller Deploy (Notfall)
|
||||
|
||||
Pipeline kaputt oder Runner offline:
|
||||
|
||||
```bash
|
||||
npm ci && npx tsc --noEmit && npm run build
|
||||
pscp -r dist root@hocks.eu:/tmp/dist-neu
|
||||
ssh root@hocks.eu "rm -rf /opt/mieterportal/dist/* && cp -a /tmp/dist-neu/. /opt/mieterportal/dist/"
|
||||
```
|
||||
|
||||
## Wartung
|
||||
|
||||
- **Runner-Logs:** `docker logs act-runner`
|
||||
- **Runner neu starten:** `cd /opt/act-runner && docker compose restart`
|
||||
- **Neuen Runner registrieren:** Registrierungstoken erzeugen
|
||||
(Gitea Admin → Actions → Runners, oder API
|
||||
`POST /api/v1/admin/actions/runners/registration-token`), dann als
|
||||
`GITEA_RUNNER_REGISTRATION_TOKEN` in die Compose-Datei eintragen,
|
||||
`data/.runner` löschen und Container neu starten. Token danach wieder aus
|
||||
der Compose-Datei entfernen.
|
||||
@@ -841,3 +841,10 @@ Zustellung an axel@hocks.eu status=sent, Test-Ticket bereinigt.
|
||||
- Ergebnis: Einstiegs-Bundle 1071 KB -> 285 KB (gzip 294->89 KB). Groesster Rest-Chunk: Dashboard 412 KB (PDF-Bibliothek) - spaeter separat lazybar.
|
||||
- Deploy + Live-Verifikation (Login-Assets, Zaehler-Chunk, kein Overflow). Commit 38e681d.
|
||||
|
||||
## 2026-10-04 — Deploy-Pipeline (Gitea Actions)
|
||||
|
||||
- act_runner-Container aufgesetzt (/opt/act-runner, Compose + config.yaml), als hocks-vps-runner in Gitea registriert, Labels: docker, ubuntu-latest.
|
||||
- Workflow .gitea/workflows/deploy.yml: Push auf main -> checkout, npm ci, tsc, Build (inkl. Anleitungs-Stand via GITHUB_SHA), Deploy nach /opt/mieterportal/dist (/mp-Mount via valid_volumes), Health-Check.
|
||||
- Zwei Fehler beim ersten Lauf behoben: valid_volumes braucht nur den Host-Pfad (nicht host:container); anleitung-meta.mjs faellt auf GITHUB_SHA zurueck wenn kein .git.
|
||||
- Run 2 erfolgreich, Portal live, Setup-Admin-Token aus Gitea-DB geloescht. Doku: DEPLOY.md. Commits 0e889ef, c71d9a8.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user