#!/bin/bash # VEDA Static Site Deployment Script # This script will deploy your Next.js static site to the production server echo "🚀 VEDA Static Site Deployment" echo "================================" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Check if out directory exists if [ ! -d "out" ]; then echo -e "${RED}❌ Error: 'out' directory not found. Run 'npm run build' first.${NC}" exit 1 fi echo -e "${GREEN}✅ Found 'out' directory with static files${NC}" echo "" echo "📋 DEPLOYMENT INSTRUCTIONS:" echo "===========================" echo "" echo -e "${YELLOW}1. Copy these files to your server:${NC}" echo " - Upload the 'out' directory" echo " - Upload the 'Caddyfile'" echo "" echo -e "${YELLOW}2. Run these commands on your server:${NC}" echo "" cat << 'EOF' # Create the web directory if it doesn't exist sudo mkdir -p /var/www/veda # Copy the static files (adjust path as needed) sudo cp -r out/* /var/www/veda/out/ 2>/dev/null || { sudo mkdir -p /var/www/veda/out sudo cp -r out/* /var/www/veda/out/ } # Set proper permissions sudo chown -R www-data:www-data /var/www/veda/ 2>/dev/null || sudo chown -R caddy:caddy /var/www/veda/ # Backup current Caddyfile sudo cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.backup.$(date +%Y%m%d_%H%M%S) 2>/dev/null # Update Caddyfile (adjust path if different) sudo cp Caddyfile /etc/caddy/Caddyfile # Test Caddy configuration sudo caddy validate --config /etc/caddy/Caddyfile # Reload Caddy sudo systemctl reload caddy # Check Caddy status sudo systemctl status caddy EOF echo "" echo -e "${YELLOW}3. Test your deployment:${NC}" echo " https://www2.veda-egypt.com/" echo " https://www2.veda-egypt.com/story/" echo " https://www2.veda-egypt.com/dahabiyas/" echo " https://www2.veda-egypt.com/experiences/" echo "" echo -e "${GREEN}📁 Files ready for deployment:${NC}" ls -la out/ | head -10 echo " ... and more" echo "" echo -e "${GREEN}✅ All files prepared! Copy the commands above and run them on your server.${NC}"