feat: manual deploy-app workflow for apps/ with build support

Add workflow_dispatch-only deploy-app action, deploy-app.sh script,
apps/_template for Cursor, and SOUL/README split between static
webhook deploy and app compose profiles.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-07-05 16:47:59 +02:00
parent 3c418e6ad1
commit deac59d55a
8 changed files with 197 additions and 8 deletions
+26 -5
View File
@@ -7,18 +7,25 @@ Experimentier-Site auf [playground.schwenk.online](https://playground.schwenk.on
1. Issue in Gitea öffnen, z. B. *„Onepager: Thema XY“*
2. Kommentar: `@cursor recherchiere zu Thema XY und generiere einen Onepager als plain HTML`
3. Gitea Action ([cursor-gitea-agent](https://gitea.schwenk.online/froxxxy/cursor-gitea-agent)) committet nach `public/<slug>/` auf `main`
4. Push-Webhook triggert `git pull` im Container-Stack → nginx liefert die Seite aus
4. Push-Webhook triggert `git pull` → nginx liefert statische Seiten aus
**Apps** (npm, Docker, DB): Code unter `apps/<slug>/`, Deploy nur manuell — siehe unten.
Content-Konventionen: siehe [SOUL.md](SOUL.md).
## Repo-Layout
```
public/ # Webroot
public/ # Webroot (statisch, auto-deploy per Push-Webhook)
apps/ # Web-Apps mit Build/Docker (manueller Deploy-Workflow)
nginx/ # nginx-Konfiguration
hooks/ # Webhook-Skripte + hooks.json.template
deploy-hook/ # Dockerfile für Webhook-Container (git pull)
compose.yml # nginx + deploy-hook auf Traefik-Netz
hooks/ # Webhook-Skripte (nur git pull für static)
deploy-hook/ # Webhook-Container
scripts/ # deploy-app.sh (Gitea Action auf boka)
compose.yml # nginx + deploy-hook + optionale App-Profiles
.gitea/workflows/
cursor.yml # @cursor in Issues
deploy-app.yml # manuell: Build + docker compose --profile
```
Auf boka ist `/home/frank/playground.schwenk.online` ein **Git-Clone** dieses Repos.
@@ -29,6 +36,8 @@ Auf boka ist `/home/frank/playground.schwenk.online` ein **Git-Clone** dieses Re
2. **Repo-Secrets** (Namen ohne `GITEA_`-Prefix):
- `CURSOR_API_KEY` — Cursor API key
- `CURSOR_BOT_TOKEN` — Gitea API token des `cursor`-Users
- `DEPLOY_GIT_TOKEN` — für App-Deploy-Workflow (`git pull` auf boka); kann identisch mit Bot-Token sein
- `DEPLOY_ROOT` (optional) — Default `/home/frank/playground.schwenk.online`
3. **Push-Webhook** (Repo → Einstellungen → Webhooks):
- URL: `https://playground.schwenk.online/hooks/deploy`
- Content type: `application/json`
@@ -90,3 +99,15 @@ docker compose up -d
## Beispiel-URL nach erstem Onepager
`https://playground.schwenk.online/thema-xy/` — wenn Cursor `public/thema-xy/index.html` angelegt hat.
## Apps deployen (manuell)
Für `apps/<slug>/` mit npm/Docker/DB — **nicht** über den Push-Webhook.
1. `@cursor` legt App unter `apps/<slug>/` an + `compose.yml`-Profile (Vorlage: `apps/_template/`)
2. Push auf `main` (Webhook zieht nur Dateien, baut die App nicht)
3. Gitea → Actions → **Deploy App (manual)** → Run workflow → `app` = `<slug>`
Der Workflow ruft `scripts/deploy-app.sh` auf boka auf: `git pull`, optional `npm ci && build`, dann `docker compose --profile <slug> up -d --build`.
**Nur manuell** — kein Push-, kein Issue-Trigger. Optional pro App: `.gitea/workflows/deploy-<slug>.yml` aus `apps/_template/workflow-deploy.yml.template` (ebenfalls nur `workflow_dispatch`).