Download deploy.sh from ahn009/Oxinto-AI: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/spaces/ahn009/Oxinto-AI/resolve/main/deploy.sh
- Command line
-
hf download hf://spaces/ahn009/Oxinto-AI/deploy.sh
-
curl -L -o deploy.sh https://huggingface.co/spaces/ahn009/Oxinto-AI/resolve/main/deploy.sh
2.01 kB
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Deploy Oxinto AI backend to Hugging Face Spaces | |
| # Usage: bash deploy.sh | |
| # Requires: git, huggingface-cli (pip install huggingface_hub) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| set -euo pipefail | |
| HF_REPO="https://huggingface.co/spaces/ahn009/Oxinto-AI" | |
| HF_REPO_GIT="https://huggingface.co/spaces/ahn009/Oxinto-AI" | |
| DEPLOY_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| WORK_DIR="/tmp/oxinto-hf-deploy" | |
| echo "π Deploying Oxinto AI backend to Hugging Face Spaces..." | |
| # 1. Authenticate with HF (uses HF_TOKEN env var or cached login) | |
| if [ -z "${HF_TOKEN:-}" ]; then | |
| echo "β οΈ HF_TOKEN not set. Attempting cached login..." | |
| huggingface-cli whoami || { echo "β Run: huggingface-cli login"; exit 1; } | |
| fi | |
| # 2. Clone or update the HF Space repo | |
| if [ -d "$WORK_DIR/.git" ]; then | |
| echo "π₯ Pulling latest from HF Space..." | |
| git -C "$WORK_DIR" pull | |
| else | |
| echo "π₯ Cloning HF Space repo..." | |
| rm -rf "$WORK_DIR" | |
| GIT_LFS_SKIP_SMUDGE=1 git clone "$HF_REPO_GIT" "$WORK_DIR" | |
| fi | |
| # 3. Copy backend files into the cloned repo (overwrite) | |
| echo "π Copying backend files..." | |
| rsync -av --exclude='.git' --exclude='deploy.sh' "$DEPLOY_DIR/" "$WORK_DIR/" | |
| # 4. Commit and push | |
| cd "$WORK_DIR" | |
| git add -A | |
| git commit -m "Deploy Oxinto AI backend $(date '+%Y-%m-%d %H:%M')" || echo "Nothing to commit." | |
| git push | |
| echo "" | |
| echo "β Deployment complete!" | |
| echo " Space URL : $HF_REPO" | |
| echo " API URL : https://ahn009-oxinto-ai.hf.space" | |
| echo " Health : https://ahn009-oxinto-ai.hf.space/health" | |
| echo " Docs : https://ahn009-oxinto-ai.hf.space/docs" | |