diff --git a/deploy.sh b/deploy.sh index 00262bf..c775c43 100755 --- a/deploy.sh +++ b/deploy.sh @@ -135,6 +135,23 @@ echo "" echo "--- Collecting static files ---" docker compose -f "$COMPOSE_FILE" exec -T web python manage.py collectstatic --noinput +echo "" +echo "--- Updating nginx config ---" +NGINX_CONF="$PROD_DIR/deploy-production/nginx.conf" +NGINX_DEST="/etc/nginx/sites-enabled/stiftung" +if [[ -f "$NGINX_CONF" ]]; then + if ! diff -q "$NGINX_CONF" "$NGINX_DEST" &>/dev/null; then + echo "Nginx config changed — updating and reloading" + sudo cp "$NGINX_CONF" "$NGINX_DEST" + sudo nginx -t && sudo systemctl reload nginx + echo "Nginx reloaded" + else + echo "Nginx config unchanged — skipping" + fi +else + echo "WARNUNG: $NGINX_CONF nicht gefunden — nginx nicht aktualisiert" +fi + echo "" echo "--- Service status ---" docker compose -f "$COMPOSE_FILE" ps