File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed
Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 99 dest : app.py
1010 - source : requirements.txt
1111 dest : requirements.txt
12+ - source : README.md
13+ dest : README.md
14+ - source : README_ZH.md
15+ dest : README_ZH.md
16+ - source : LICENSE
17+ dest : LICENSE
Original file line number Diff line number Diff line change 1+ name : Push demo branch to Hugging Face
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ ref :
7+ required : false
8+ default : demo
9+ type : string
10+ secrets :
11+ HF_TOKEN :
12+ required : true
13+
14+ jobs :
15+ push-hf :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+ with :
21+ ref : ${{ inputs.ref }}
22+ token : ${{ secrets.GITHUB_TOKEN }}
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install huggingface_hub
28+
29+ - name : Push to Hugging Face
30+ env :
31+ HF_TOKEN : ${{ secrets.HF_TOKEN }}
32+ HF_REPO_TYPE : space
33+ HF_REPO_ID : chenzihong/GraphGen
34+ run : |
35+ huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential
36+ git clone https://huggingface.co/$HF_REPO_TYPE/$HF_REPO_ID hf-repo
37+ rsync -a --delete --exclude='.git' ./ hf-repo/
38+ cd hf-repo
39+ git add .
40+ git diff-index --quiet HEAD || (git commit -m "Auto-sync from ${{ inputs.ref }} at $(date -u)" && git push)
Original file line number Diff line number Diff line change 6868 else
6969 echo "No changes to sync"
7070 fi
71+
72+ push-hf :
73+ needs : sync-demo
74+ uses : ./.github/workflows/push-to-hf.yml
75+ secrets :
76+ HF_TOKEN : ${{ secrets.HF_TOKEN }}
You can’t perform that action at this time.
0 commit comments