Spaces:
Runtime error
Runtime error
Download deploy.sh from Amitkasar/ai-api-testing: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/deploy.sh
- Command line
-
hf download hf://spaces/Amitkasar/ai-api-testing/deploy.sh
-
curl -L -o deploy.sh https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/deploy.sh
1.47 kB
| # Exit immediately if a command exits with a non-zero status | |
| set -e | |
| echo "π Starting Full Deployment Process..." | |
| echo "" | |
| # ========================================== | |
| # 1. Deploy Backend to Hugging Face | |
| # ========================================== | |
| echo "π¦ [1/2] Deploying Backend to Hugging Face Spaces..." | |
| cd "$(dirname "$0")" | |
| # Check if there are changes to commit | |
| if [[ -n $(git status -s) ]]; then | |
| git add . | |
| # Prompt for an optional commit message | |
| read -p "Enter commit message (or press enter for default 'Auto-deployment update'): " commit_msg | |
| commit_msg=${commit_msg:-"Auto-deployment update"} | |
| git commit -m "$commit_msg" | |
| echo "Pushing to Hugging Face... (You may be prompted for your Username and Access Token)" | |
| git push | |
| echo "β Backend successfully pushed to Hugging Face!" | |
| else | |
| echo "β‘ No backend changes detected. Skipping git push." | |
| fi | |
| echo "" | |
| # ========================================== | |
| # 2. Deploy Frontend to Vercel | |
| # ========================================== | |
| echo "π [2/2] Deploying Frontend to Vercel..." | |
| cd frontend-react | |
| # Check if Vercel CLI is installed | |
| if ! command -v vercel &> /dev/null; then | |
| echo "β Vercel CLI could not be found. Please install it first with:" | |
| echo " sudo npm install -g vercel" | |
| exit 1 | |
| fi | |
| # Deploy to production | |
| echo "Running Vercel production deployment..." | |
| vercel --prod | |
| echo "" | |
| echo "π All Done! Your project is fully deployed." | |