diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 2243eedc..6987a2a5 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -29,7 +29,7 @@ jobs: sudo chown -R www-data:www-data /var/www/atom-media sudo chmod -R 775 /var/www/atom-media - # [CRUCIAL STEP]: Red de huidige live uploads (nieuws, logo's) EERST voordat Git of de build iets wist + # Red de huidige live uploads (nieuws, logo's) EERST voordat Git of de build iets wist cd /var/www/atom-nexst/ if [ -d .next/standalone/public ]; then echo "Backing up current live images and uploads..." @@ -85,16 +85,20 @@ jobs: rsync -av /var/www/atom-media/ .next/standalone/public/ fi - # 7. Permissions & Restart + # 7. Permissions (GEBRACHT VÓÓR HET HERSTARTEN) + # We forceren de rechten NU op alle gekopieerde bestanden, inclusief de teruggezette rsync-bestanden sudo chown -R www-data:www-data /var/www/atom-nexst/ sudo chmod -R g+rw /var/www/atom-nexst/ + # 8. Restart & Check echo "Restarting systemd service gracefully..." + sudo systemctl daemon-reload sudo systemctl restart atom-nexst.service - sleep 2 + # Geef Node.js 3 seconden de tijd om op te starten en de databaseverbinding te openen + sleep 3 if ! systemctl is-active --quiet atom-nexst.service; then - echo "ERROR: atom-nexst.service failed to start!" >&2 + echo "ERROR: atom-nexst.service failed to start! Check logs using: journalctl -u atom-nexst.service" >&2 exit 1 fi