A simple script where it pulls that latest changes from git repo(s) (tanlged), then restarts nginx
Pull git - Update Ningx with changes
29 lines 739 B view raw
1#!/bin/bash 2 3echo "================================================" 4echo "Updating websites at $(date)" 5echo "================================================" 6 7# Update madebydanny.uk 8echo "→ Updating madebydanny.uk..." 9cd /var/www/madebydanny 10git pull origin main 11echo "✓ madebydanny.uk updated" 12echo "" 13 14# Update pds.madebydanny.uk 15echo "→ Updating pds.madebydanny.uk..." 16cd /var/www/pds-madebydanny 17git pull origin main 18echo "✓ pds.madebydanny.uk updated" 19echo "" 20 21# Reload nginx 22echo "→ Reloading nginx..." 23sudo systemctl reload nginx 24echo "✓ Nginx reloaded" 25echo "" 26 27echo "================================================" 28echo "All websites updated successfully!" 29echo "================================================"