23 lines
1012 B
Markdown
23 lines
1012 B
Markdown
# Automatisches Produktions-Deployment
|
|
|
|
Der Workflow `workflows/deploy-production.yml` startet bei jedem Push auf
|
|
`main` das Script `deploy-production.sh` im Produktions-Checkout
|
|
`/var/www/timeclock`.
|
|
|
|
Einmalig im Gitea-Repository unter **Settings → Actions → Secrets** anlegen:
|
|
|
|
- `TIMECLOCK_DEPLOY_HOST`: Hostname des Produktionsservers, z. B.
|
|
`stechuhr3.tsschulz.de`
|
|
- `TIMECLOCK_DEPLOY_USER`: Linux-Benutzer mit Zugriff auf den Checkout und PM2
|
|
- `TIMECLOCK_DEPLOY_SSH_PRIVATE_KEY`: privater SSH-Schlüssel dieses Deploy-
|
|
Benutzers
|
|
- `TIMECLOCK_DEPLOY_SSH_KNOWN_HOSTS`: Ausgabe von
|
|
`ssh-keyscan -H stechuhr3.tsschulz.de`
|
|
|
|
Der öffentliche Teil des Deploy-Schlüssels muss auf dem Produktionsserver in
|
|
`~/.ssh/authorized_keys` des Deploy-Benutzers hinterlegt sein. Der Gitea
|
|
Actions-Runner benötigt außerdem Netzwerkzugang per SSH zum Server.
|
|
|
|
Vor dem ersten Push muss `/var/www/timeclock` bereits der Checkout dieses
|
|
Repositories sein und die ausführbare Datei `deploy-production.sh` enthalten.
|