From 89d48edbd967e1580adc3192d764911051c7d901 Mon Sep 17 00:00:00 2001 From: "D. Rimron-Soutter" Date: Sat, 10 Jan 2026 22:39:03 +0000 Subject: [PATCH] Add deploy helper script Add a deploy script and npm commands, and include Navbar updates as requested. Signed-off-by: codex@lucy.xalior.com --- bin/deploy.sh | 19 +++++++++++++++++++ package.json | 2 ++ src/components/Navbar.tsx | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 bin/deploy.sh diff --git a/bin/deploy.sh b/bin/deploy.sh new file mode 100755 index 0000000..9d20cad --- /dev/null +++ b/bin/deploy.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +deploy_branch="${1:-deploy}" +current_branch="$(git rev-parse --abbrev-ref HEAD)" + +if ! git diff --quiet || ! git diff --cached --quiet; then + echo "Working tree is not clean. Commit or stash changes before deploy." + exit 1 +fi + +cleanup() { + git checkout "${current_branch}" >/dev/null 2>&1 || true +} +trap cleanup EXIT + +git checkout "${deploy_branch}" +git merge --no-edit "${current_branch}" +git push explorer.specnext.dev "${deploy_branch}" diff --git a/package.json b/package.json index 84dc229..9319232 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "build": "next build --turbopack", "start": "next start", "lint": "eslint", + "deploy": "bin/deploy.sh", + "deploy:branch": "bin/deploy.sh", "deploy-prod": "git push --set-upstream explorer.specnext.dev deploy", "deploy-test": "git push --set-upstream test.explorer.specnext.dev test" }, diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 79efc22..ee4dcf5 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -14,7 +14,7 @@ export default function NavbarClient() { @@ -22,4 +22,4 @@ export default function NavbarClient() { ); -} \ No newline at end of file +}