# Staging Deployment > **Staging URL:** https://pl.porwoll.tech > **Server:** sv-payload (37.24.237.181) > **Branch:** `develop` > **Siehe auch:** [DEPLOYMENT_STRATEGY.md](./DEPLOYMENT_STRATEGY.md) für die vollständige Deployment-Strategie --- ## Trigger | Trigger | Beschreibung | |---------|-------------| | **Push auf `develop`** | Automatisches Deployment | | **workflow_dispatch** | Manuelles Deployment via GitHub UI | --- ## Workflow-Ablauf ### 1. Pre-deployment Checks (~1 Min) - ESLint prüfen - Unit Tests ausführen - Bei Fehler: Deployment wird abgebrochen ### 2. Deploy to Staging (~2-3 Min) 1. SSH-Verbindung zum Server 2. `git fetch origin develop && git reset --hard origin/develop` 3. `pnpm install --frozen-lockfile` 4. `pnpm payload migrate` 5. `pnpm build` (mit Memory-Limit 2GB) 6. `pm2 restart payload queue-worker` 7. Health Check auf `http://localhost:3000/admin` --- ## Manuelles Deployment ### Via GitHub UI 1. Gehe zu: https://github.com/c2s-admin/cms.c2sgmbh/actions 2. Wähle "Deploy to Staging" 3. Klicke "Run workflow" 4. Optional: "Skip tests" aktivieren ### Via CLI (auf dem Server) ```bash ./scripts/deploy-staging.sh ./scripts/deploy-staging.sh --skip-build ./scripts/deploy-staging.sh --skip-migrations DEPLOY_BRANCH=feature/xyz ./scripts/deploy-staging.sh ``` ### Via SSH (Remote) ```bash ssh payload@37.24.237.181 'cd ~/payload-cms && ./scripts/deploy-staging.sh' ``` --- ## Konfiguration ### GitHub Secrets | Secret | Beschreibung | |--------|-------------| | `STAGING_SSH_KEY` | SSH Private Key für `payload@37.24.237.181` | ### Environment | Variable | Wert | |----------|------| | `STAGING_HOST` | 37.24.237.181 | | `STAGING_USER` | payload | | `STAGING_PATH` | /home/payload/payload-cms | --- ## Troubleshooting ### Build schlägt fehl (OOM) ```bash pm2 stop all NODE_OPTIONS="--max-old-space-size=1536" pnpm build pm2 start ecosystem.config.cjs ``` ### SSH-Verbindung fehlgeschlagen 1. `STAGING_SSH_KEY` Secret prüfen 2. Public Key in `~/.ssh/authorized_keys` prüfen 3. Server erreichbar: `ping 37.24.237.181` ### Service startet nicht ```bash pm2 status pm2 logs payload --err --lines 100 pm2 start ecosystem.config.cjs ``` --- ## Branching-Strategie | Branch | Deployment | URL | |--------|------------|-----| | `main` | Produktion (manuell) | cms.c2sgmbh.de | | `develop` | Staging (automatisch) | pl.porwoll.tech | --- *Letzte Aktualisierung: 29.12.2025*