Spaces:
Sleeping
Sleeping
| # Stop execution immediately if any command fails | |
| set -e | |
| echo "--- Starting Deployment Script ---" | |
| # 1. Clone to a temporary folder | |
| echo "Cloning private repository..." | |
| git clone https://$GH_TOKEN@github.com/$GH_REPO.git temp_repo | |
| # 2. Move files to root | |
| echo "Moving files to root..." | |
| cp -r temp_repo/. . | |
| rm -rf temp_repo | |
| # 3. Install dependencies | |
| if [ -f requirements.txt ]; then | |
| echo "Installing additional requirements..." | |
| pip install --no-cache-dir -r requirements.txt | |
| fi | |
| # 4. Start API server | |
| echo "Starting API server..." | |
| uvicorn main:app --host 0.0.0.0 --port 7860 |