diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2273395..a7eed6af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,11 @@ on: push: branches: - main + paths-ignore: + - ".husky/**" + - ".github/workflows/deploy-docs.yml" + - ".github/workflows/release.yml" + - "site/**" env: # Bump this when Tauri/Rust target artifacts capture stale absolute paths. diff --git a/.husky/pre-commit b/.husky/pre-commit index 330b8388..4310a7e7 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -40,8 +40,36 @@ ensure_node_tooling echo "🔍 Pre-commit checks..." +STAGED_FILES=$(git diff --cached --name-only) +APP_CHANGED=false +SITE_CHANGED=false + +for FILE in $STAGED_FILES; do + case "$FILE" in + site/*) + SITE_CHANGED=true + ;; + .github/workflows/*|.husky/*|docs/*|*.md) + ;; + *) + APP_CHANGED=true + ;; + esac +done + +if [ "$APP_CHANGED" = false ]; then + if [ "$SITE_CHANGED" = true ]; then + echo " → docs build..." + pnpm docs:build + else + echo " → app checks skipped (docs/workflow/hooks only)" + fi + echo "✅ Pre-commit passed" + exit 0 +fi + # Lint + types (only if TS files staged) -STAGED_TS=$(git diff --cached --name-only | grep -E '\.(ts|tsx)$' || true) +STAGED_TS=$(echo "$STAGED_FILES" | grep -E '\.(ts|tsx)$' || true) if [ -n "$STAGED_TS" ]; then echo " → lint + tsc..." pnpm lint --quiet diff --git a/.husky/pre-push b/.husky/pre-push index 2d76af4b..9c4b8e91 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -95,12 +95,43 @@ echo "================================================" # ── Detect what changed ───────────────────────────────────────────────── PUSH_TARGET=$(git rev-parse @{push} 2>/dev/null || echo "") RUST_CHANGED=true +APP_CHANGED=true +SITE_CHANGED=false if [ -n "$PUSH_TARGET" ]; then CHANGED=$(git diff --name-only "$PUSH_TARGET"..HEAD) + APP_CHANGED=false if ! echo "$CHANGED" | grep -qE '^(src-tauri/|Cargo)'; then RUST_CHANGED=false fi + for FILE in $CHANGED; do + case "$FILE" in + site/*) + SITE_CHANGED=true + ;; + .github/workflows/*|.husky/*|docs/*|*.md) + ;; + *) + APP_CHANGED=true + ;; + esac + done +fi + +if [ "$APP_CHANGED" = false ]; then + if [ "$SITE_CHANGED" = true ]; then + echo "" + echo "📚 Docs-only push detected; running docs build..." + pnpm docs:build + echo " ✅ Docs build OK" + else + echo "" + echo "⏭️ App checks skipped (docs/workflow/hooks only)" + fi + ELAPSED=$(($(date +%s) - START_TIME)) + echo "" + echo "✅ Pre-push passed in ${ELAPSED}s" + exit 0 fi # ── 0. TypeScript + Vite build ────────────────────────────────────────── diff --git a/site/.vitepress/theme/Layout.vue b/site/.vitepress/theme/Layout.vue index 1fde4cb6..09233088 100644 --- a/site/.vitepress/theme/Layout.vue +++ b/site/.vitepress/theme/Layout.vue @@ -1,10 +1,22 @@