-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (37 loc) · 1.23 KB
/
deploy-hf-space.yml
File metadata and controls
44 lines (37 loc) · 1.23 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
name: Deploy HF Space
on:
push:
branches: [main]
paths:
- 'apps/hdp-physical-hf/**'
jobs:
deploy:
name: Sync to helixar-ai/hdp-physical-demo
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Push to HuggingFace Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git config --global user.email "ci@helixar.ai"
git config --global user.name "Helixar AI"
# Clone the Space
git clone "https://user:${HF_TOKEN}@huggingface.co/spaces/helixar-ai/hdp-physical-demo" /tmp/hf-space
# Sync app files (overwrite)
cp apps/hdp-physical-hf/app.py /tmp/hf-space/app.py
cp apps/hdp-physical-hf/requirements.txt /tmp/hf-space/requirements.txt
cp apps/hdp-physical-hf/README.md /tmp/hf-space/README.md
# Commit and push only if there are changes
cd /tmp/hf-space
git add -A
if git diff --cached --quiet; then
echo "No changes to push."
else
git commit -m "chore: sync from main (${GITHUB_SHA::7})"
git push origin main
fi