Samad14's picture
fix(deploy): use hf CLI (huggingface-cli removed in hub 1.x) and pass HF_TOKEN; exclude .env from space upload
5b7cd01
Raw History Blame Contribute Delete
1.15 kB
name: Deploy
on:
push:
branches: [main]
jobs:
deploy-backend:
name: Deploy Backend to HuggingFace Spaces
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Push to HuggingFace Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pip install -U huggingface_hub
hf upload Samad14/bio-nexus-api bioai-platform/backend --repo-type space --exclude "**/.env" --exclude "**/.env.deploy" --exclude "**/__pycache__/**"
deploy-frontend:
name: Deploy Frontend to Vercel
runs-on: ubuntu-latest
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Ensure backend API URL is set
run: npx vercel env add NEXT_PUBLIC_API_URL production https://samad14-bio-nexus-api.hf.space --project prj_ylJFEbddC3dQsqLVsKyhMWDMHqeG --scope team_y6MYl4hpatRBHMHSwAzCzQ5f --token "$VERCEL_TOKEN" || true
- name: Deploy to Vercel
run: npx vercel --token "$VERCEL_TOKEN" --project prj_ylJFEbddC3dQsqLVsKyhMWDMHqeG --scope team_y6MYl4hpatRBHMHSwAzCzQ5f --prod --yes