Skip to content

Commit 844455e

Browse files
Update deploy.yml
1 parent 2c54b8f commit 844455e

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
name: Deploy to Hugging Face Space 🚀
1+
name: Sync to Hugging Face hub
22

33
on:
44
push:
5-
branches:
6-
- main # or your chosen branch
5+
branches: [main] # Adjust if your branch is not 'main'
6+
7+
workflow_dispatch: # Allows manual triggering from GitHub UI
78

89
jobs:
9-
deploy:
10+
sync-to-hub:
1011
runs-on: ubuntu-latest
1112

1213
steps:
13-
- name: Checkout the repo
14+
- name: Checkout repo
1415
uses: actions/checkout@v3
15-
16-
- name: Deploy to Hugging Face Space
17-
uses: huggingface/huggingface_hub@v0.18.0
1816
with:
19-
repo-type: space
20-
space-id: daniellegauthier/RGB-Root-Matriz-Color-Plotter
21-
huggingface_token: ${{ secrets.SYNC_TO_HUGGING_FACE_HUB }} # 👈 securely inject the token
17+
fetch-depth: 0
18+
lfs: true # If you're using large files
19+
20+
- name: Set Git identity
21+
run: |
22+
git config --global user.email "github-actions@github.com"
23+
git config --global user.name "github-actions"
24+
25+
- name: Push to Hugging Face Space
26+
env:
27+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
28+
run: |
29+
git remote add hf https://daniellegauthier:$HF_TOKEN@huggingface.co/spaces/daniellegauthier/RGB-Root-Matriz-Color-Plotter
30+
git push -f hf main # Force push to overwrite if needed

0 commit comments

Comments
 (0)