1.1 KiB
1.1 KiB
Automatisches Produktions-Deployment
Der Workflow workflows/deploy-production.yml aktualisiert bei jedem Push auf
main zunächst den Produktions-Checkout /var/www/timeclock per
Fast-forward und startet dann deploy-production.sh.
Einmalig im Gitea-Repository konfigurieren:
- Unter Settings → Actions → Variables:
TIMECLOCK_DEPLOY_HOST: Hostname des ProduktionsserversTIMECLOCK_DEPLOY_USER: Linux-Benutzer mit Zugriff auf den Checkout und PM2TIMECLOCK_DEPLOY_SSH_KNOWN_HOSTS: Ausgabe vonssh-keyscan -H <TIMECLOCK_DEPLOY_HOST>
- Unter Settings → Actions → Secrets:
TIMECLOCK_DEPLOY_SSH_PRIVATE_KEY: privater SSH-Schlüssel dieses Deploy-Benutzers
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.