new-site/scripts/deploy-dev.sh
justin bd9a70607f fix: maintain Services dropdown header from one canonical source
The site header / Services mega-dropdown was duplicated across two render
systems (Astro pages via Base.astro->nav.html, and ~80 pre-rendered static
public/**/index.html pages each embedding their own copy). They had drifted
into 5 different variants (missing 'New Carrier Setup', misplaced Healthcare
column, NEW vs FREE badges, em-dash encoding differences), so
dev.performancewest.net, the order pages, and the rest of the site disagreed.

- Make site/src/partials/nav.html the single source of truth (adopts the most
  complete variant).
- Add scripts/sync_nav.py to rewrite every static page's <nav> block from
  nav.html (idempotent; --check guards against drift in CI/deploy).
- Run the sync automatically in deploy.sh and scripts/deploy-dev.sh.
- Deprecate scripts/inject_healthcare_nav.py (now delegates to sync_nav.py).
- Neutralize the broken no-op SiteNav.astro component.

All 80 headers + the Astro-built order pages now render the identical dropdown.
2026-06-05 14:27:24 -05:00

66 lines
2 KiB
Bash
Executable file

#!/usr/bin/env bash
# Deploy to the dev site at dev.performancewest.net.
# Usage: bash scripts/deploy-dev.sh
#
# What it does:
# 1. Syncs API source + scripts + site to the dev server
# 2. Rebuilds dev API + site Docker containers
# 3. No manual docker-cp or _astro merging needed — everything
# is in site/public/ and gets built into the image.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Single source of truth for the header: rewrite every static page's <nav>
# block from site/src/partials/nav.html so the Services dropdown can never
# drift between dev.performancewest.net, the order pages, and the rest of
# the site. Idempotent.
echo "=== Syncing canonical site header (Services dropdown) ==="
python3 "$SCRIPT_DIR/sync_nav.py"
REMOTE="deploy@207.174.124.71"
SSH="ssh -p 22022"
SCP="scp -P 22022"
DEV_DIR="/opt/performancewest-dev"
RSYNC_OPTS="-avz --delete --exclude=node_modules --exclude=.git --exclude='__pycache__' --exclude=dist --exclude=.env --exclude='site-old'"
echo "=== Syncing source files ==="
rsync $RSYNC_OPTS \
-e "$SSH" \
api/src/ "$REMOTE:$DEV_DIR/api/src/"
rsync $RSYNC_OPTS \
-e "$SSH" \
api/migrations/ "$REMOTE:$DEV_DIR/api/migrations/"
rsync $RSYNC_OPTS \
-e "$SSH" \
scripts/ "$REMOTE:$DEV_DIR/scripts/"
rsync $RSYNC_OPTS \
-e "$SSH" \
site/src/ "$REMOTE:$DEV_DIR/site/src/"
rsync $RSYNC_OPTS \
-e "$SSH" \
site/public/ "$REMOTE:$DEV_DIR/site/public/"
# Also sync config files that live at the site root
for f in site/Dockerfile site/nginx.conf site/package.json site/astro.config.mjs site/tsconfig.json; do
if [ -f "$f" ]; then
rsync -avz -e "$SSH" "$f" "$REMOTE:$DEV_DIR/$f"
fi
done
echo ""
echo "=== Rebuilding containers ==="
$SSH "$REMOTE" "cd $DEV_DIR && sudo docker compose up -d --build api site workers"
echo ""
echo "=== Deploy complete ==="
echo "Dev site: https://dev.performancewest.net"
echo "Dev API: https://api.dev.performancewest.net"