Skip to content

Commit c7a21f9

Browse files
committed
Add GitHub Actions workflow for syncing to Hugging Face hub on push to main
1 parent 84904b5 commit c7a21f9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/cd-hf.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Sync to Hugging Face hub
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
7+
jobs:
8+
sync-to-hub:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
lfs: true
15+
16+
- name: Sanity-check token
17+
env:
18+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
19+
run: |
20+
if [ -z "$HF_TOKEN" ]; then
21+
echo "HF_TOKEN is empty ‼️"; exit 1;
22+
fi
23+
echo "Token length: ${#HF_TOKEN}"
24+
25+
- name: Push to hub
26+
env:
27+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
28+
run: git push https://serverdaun:$HF_TOKEN@huggingface.co/spaces/serverdaun/rag-w-binary-quant.git main --force

0 commit comments

Comments
 (0)