From 5abeb91144001265b6cbdf1df27de13af2b8e1a3 Mon Sep 17 00:00:00 2001 From: Possible Date: Fri, 28 Feb 2025 20:48:07 +0100 Subject: [PATCH] Update | Deploy Script --- deploy.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ redeploy.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 deploy.sh create mode 100644 redeploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..37cba19 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# Exit on any error +set -e + +echo "🚀 Starting deployment process..." + +# Configuration +DEPLOY_PATH="/var/www/wireframev5.manaknightdigital.com" +NGINX_CONFIG="/etc/nginx/sites-available/wireframev5.manaknightdigital.com" + +# Build the application +echo "📦 Building application..." +npm install +npm run build + +# Ensure deploy directory exists +echo "📁 Setting up deployment directory..." +sudo mkdir -p $DEPLOY_PATH + +# Copy build files to deployment directory +echo "📋 Copying files to deployment directory..." +sudo cp -r dist/* $DEPLOY_PATH/ + +# Set proper permissions +echo "🔒 Setting permissions..." +sudo chown -R www-data:www-data $DEPLOY_PATH +sudo chmod -R 755 $DEPLOY_PATH + +# Create Nginx configuration if it doesn't exist +if [ ! -f "$NGINX_CONFIG" ]; then + echo "📝 Creating Nginx configuration..." + sudo tee $NGINX_CONFIG > /dev/null < /dev/null <