File size: 1,338 Bytes
c0a5e0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# Deploy the LarQL Vindex Viewer to HuggingFace Spaces (Divinci-AI/vindex-viewer)
#
# First-time setup:
#   pip install -U huggingface_hub
#   hf auth login    # paste your write token from https://huggingface.co/settings/tokens
#
# Usage:
#   ./deploy.sh                # incremental upload of changed files (creates space if missing)
#   ./deploy.sh --create-only  # just create the space, don't upload
#
# After deploy, the viewer is live at:
#   https://huggingface.co/spaces/Divinci-AI/vindex-viewer

set -euo pipefail

SPACE_ID="Divinci-AI/vindex-viewer"
HERE="$(cd "$(dirname "$0")" && pwd)"

# Try to create the Space (idempotent — succeeds even if it already exists)
echo "Ensuring Space $SPACE_ID exists..."
hf repo create "$SPACE_ID" --repo-type space --space-sdk static --exist-ok 2>&1 | grep -v "already created" || true

if [[ "${1:-}" == "--create-only" ]]; then
  echo "Created (or already exists). Exiting before upload."
  exit 0
fi

echo ""
echo "Uploading $HERE/ to $SPACE_ID ..."
hf upload "$SPACE_ID" "$HERE" . --repo-type space \
  --commit-message "$(date -u +%Y-%m-%dT%H:%M:%SZ) — viewer + assets"

echo ""
echo "✓ Deployed. Live at: https://huggingface.co/spaces/$SPACE_ID"
echo "Hero GIF URL (used by org card): https://huggingface.co/spaces/$SPACE_ID/resolve/main/vindex-hero-bg.gif"