#!/bin/bash
set -e
cd /root/Yaltopia-Project/GRV-Summit-Site
LOG=/root/Yaltopia-Project/GRV-Summit-Site/.deploy-log.txt
{
  echo "=== STATUS ==="
  git status -sb
  echo "=== ADD ==="
  git add -A
  git reset HEAD .env 2>/dev/null || true
  echo "=== COMMIT ==="
  git commit -m "$(cat <<'EOF'
Enhance footer and hero with brand geometric backgrounds.

Add low-poly footer facets with curved midline, hero last-year winners
scroll, footer surfaces and social links, and supporting brand components.
EOF
)" || echo "COMMIT_SKIPPED: nothing to commit or failed"
  echo "=== PUSH ==="
  git push origin main
  echo "=== LOG ==="
  git log -1 --oneline
  echo "=== GH RUNS ==="
  gh run list --limit 3 2>&1 || echo "gh not available"
} > "$LOG" 2>&1
echo DONE >> "$LOG"
