-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.35 KB
/
deploy-hf.yml
File metadata and controls
47 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy backend to HuggingFace Spaces
on:
push:
branches: [main]
paths:
- 'backend/**'
- 'scripts/push-hf.sh'
- '.github/workflows/deploy-hf.yml'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check HF_TOKEN secret
run: |
if [ -z "${{ secrets.HF_TOKEN }}" ]; then
echo "❌ HF_TOKEN secret is not set."
echo "Go to: GitHub repo → Settings → Secrets and variables → Actions → New repository secret"
echo "Name: HF_TOKEN | Value: your HuggingFace write token (huggingface.co/settings/tokens)"
exit 1
fi
echo "✓ HF_TOKEN is set"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install Git LFS
run: git lfs install --system
- name: Add HuggingFace remote (with token)
run: |
git remote add hf-space https://oauth2accesstoken:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/rizzvision69/app-v2-space
- name: Deploy to HuggingFace Spaces
run: bash scripts/push-hf.sh hf-space