Skip to content

Commit f385ff6

Browse files
authored
Change NGINX web root and reload on deploy
Update NGINX web root path and add nginx reload commands.
1 parent df45fba commit f385ff6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

deploy.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -euo pipefail
1313
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1414
CLIENT_DIR="$REPO_DIR/client"
1515
SERVER_DIR="$REPO_DIR/server"
16-
NGINX_WEB_ROOT="/var/www/coursehub"
16+
NGINX_WEB_ROOT="/var/www/coursehub/client"
1717
PM2_APP_NAME="coursehub-backend"
1818

1919
# ── Colours ─────────────────────────────────────────────────
@@ -50,6 +50,9 @@ deploy_frontend() {
5050
# Clear old build and copy new one
5151
sudo rm -rf "${NGINX_WEB_ROOT:?}"/*
5252
sudo cp -r "$CLIENT_DIR/dist/." "$NGINX_WEB_ROOT/"
53+
log "Reloading nginx..."
54+
sudo systemctl reload nginx
55+
sudo nginx -s reload
5356

5457
success "Frontend deployed successfully!"
5558
}
@@ -96,6 +99,9 @@ case "$TARGET" in
9699
log "Replacing files in $NGINX_WEB_ROOT ..."
97100
sudo rm -rf "${NGINX_WEB_ROOT:?}"/*
98101
sudo cp -r "$CLIENT_DIR/dist/." "$NGINX_WEB_ROOT/"
102+
log "Reloading nginx..."
103+
sudo systemctl reload nginx
104+
sudo nginx -s reload
99105
success "Frontend deployed!"
100106

101107
# Backend

0 commit comments

Comments
 (0)