IntegraChat / deploy.sh
nothingworry's picture
Add deployment scripts for Hugging Face Spaces
97637c6
#!/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 ""