#!/bin/bash # Quick deployment script for Hugging Face Spaces echo "🚀 Deploying IntegraChat to Hugging Face Spaces" echo "" # Check if git is initialized if [ ! -d ".git" ]; then echo "📦 Initializing git repository..." git init fi # Get space name from user or use default read -p "Enter your Hugging Face username: " HF_USERNAME read -p "Enter your Space name (default: integrachat): " SPACE_NAME SPACE_NAME=${SPACE_NAME:-integrachat} # Set remote URL HF_REMOTE="https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}" echo "" echo "📝 Adding files to git..." git add Dockerfile .dockerignore README_HF_SPACES.md requirements.txt app.py env.example LICENSE README.md assets/ backend/ scripts/ 2>/dev/null || true # Check if there are changes to commit if git diff --staged --quiet; then echo "⚠️ No changes to commit. Files may already be committed." else echo "💾 Committing changes..." git commit -m "Deploy IntegraChat to Hugging Face Spaces" fi echo "" echo "🔗 Setting up remote..." git remote remove hf 2>/dev/null || true git remote add hf "$HF_REMOTE" echo "" echo "📤 Pushing to Hugging Face..." echo " Remote: $HF_REMOTE" echo "" read -p "Press Enter to continue with push, or Ctrl+C to cancel..." git push hf main || git push hf master echo "" echo "✅ Deployment initiated!" echo "" echo "📋 Next steps:" echo " 1. Go to: $HF_REMOTE" echo " 2. Click 'Settings' tab" echo " 3. Add environment variables in 'Repository secrets'" echo " 4. Wait for build to complete (5-10 minutes)" echo " 5. Check 'Logs' tab for build progress" echo ""