trigo / deploy.sh
k-l-lambda's picture
the first deploy
466436b
raw
history blame
1.77 kB
#!/bin/bash
# Trigo Hugging Face Space Deployment Script
# This script copies the trigo-web project to the HF Space repo and prepares it for deployment
set -e
echo "🚀 Trigo HF Space Deployment Script"
echo "===================================="
echo ""
# Define paths
PROJECT_ROOT="/home/camus/work/trigo"
TRIGO_WEB="$PROJECT_ROOT/trigo-web"
HF_SPACE="$PROJECT_ROOT/third_party/trigo-hfspace"
# Check if directories exist
if [ ! -d "$TRIGO_WEB" ]; then
echo "❌ Error: trigo-web directory not found at $TRIGO_WEB"
exit 1
fi
if [ ! -d "$HF_SPACE" ]; then
echo "❌ Error: HF Space directory not found at $HF_SPACE"
exit 1
fi
echo "📂 Project directory: $TRIGO_WEB"
echo "📂 HF Space directory: $HF_SPACE"
echo ""
# Clean up old trigo-web in HF space if it exists
if [ -d "$HF_SPACE/trigo-web" ]; then
echo "🧹 Cleaning up old trigo-web directory..."
rm -rf "$HF_SPACE/trigo-web"
fi
# Copy trigo-web to HF space
echo "📦 Copying trigo-web to HF Space repository..."
cp -r "$TRIGO_WEB" "$HF_SPACE/"
# Remove node_modules and dist folders (will be built in Docker)
echo "🧹 Removing node_modules and dist folders (will be rebuilt in Docker)..."
find "$HF_SPACE/trigo-web" -type d -name "node_modules" -exec rm -rf {} + 2>/dev/null || true
find "$HF_SPACE/trigo-web" -type d -name "dist" -exec rm -rf {} + 2>/dev/null || true
# Remove test files
echo "🧹 Removing test files..."
rm -rf "$HF_SPACE/trigo-web/tests" 2>/dev/null || true
echo ""
echo "✅ Files prepared successfully!"
echo ""
echo "📋 Next steps:"
echo " 1. cd $HF_SPACE"
echo " 2. git add ."
echo " 3. git commit -m 'Deploy Trigo game'"
echo " 4. git push"
echo ""
echo "🌐 After pushing, HF will automatically build and deploy your app."
echo ""