Ragora-Server / deploy-hf.sh
Peterase's picture
update: sync with latest changes
657fad1
#!/bin/bash
# Hugging Face Spaces Deployment Script for Ragora Backend
echo "πŸš€ Deploying Ragora Backend to Hugging Face Spaces..."
# Check if git is initialized
if [ ! -d ".git" ]; then
echo "Initializing git repository..."
git init
fi
# Add Hugging Face remote
HF_SPACE="https://huggingface.co/spaces/Peterase/Ragora-Server"
echo "Adding Hugging Face remote: $HF_SPACE"
# Remove existing hf remote if it exists
git remote remove hf 2>/dev/null
# Add new remote
git remote add hf $HF_SPACE
# Create deployment branch
echo "Creating deployment branch..."
git checkout -b hf-deploy 2>/dev/null || git checkout hf-deploy
# Copy necessary files for HF deployment
echo "Preparing files for deployment..."
# Stage files
git add app.py
git add README.md
git add Dockerfile.hf
git add .dockerignore
git add requirements.txt
git add app/
# Commit
echo "Committing changes..."
git commit -m "deploy: update Ragora backend for Hugging Face Spaces" || echo "No changes to commit"
# Push to Hugging Face
echo "Pushing to Hugging Face Spaces..."
git push hf hf-deploy:main --force
echo "βœ… Deployment complete!"
echo "πŸ“ Your space: https://huggingface.co/spaces/Peterase/Ragora-Server"
echo ""
echo "⚠️ Don't forget to set these environment variables in your Space settings:"
echo " - GROQ_API_KEY"
echo " - CLERK_SECRET_KEY"
echo " - CLERK_JWKS_URL"
echo " - DATABASE_URL (if using external DB)"
echo " - QDRANT_HOST (if using external Qdrant)"
echo " - MINIO_ENDPOINT (if using external MinIO)"