Krish Shah-Nathwani commited on
Commit
2193025
·
1 Parent(s): 53a4d7c

Add GitHub Action for Hugging Face sync

Browse files
.github/workflows/huggingface-sync.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face Space
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # Triggers on push to the 'main' branch
7
+ workflow_dispatch: # Allows manual triggering of the workflow
8
+
9
+ jobs:
10
+ sync:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ # Step 1: Checkout the repository
15
+ - name: Checkout repository
16
+ uses: actions/checkout@v2
17
+
18
+ # Step 2: Install huggingface-cli
19
+ - name: Install Hugging Face CLI
20
+ run: pip install huggingface-hub
21
+
22
+ # Step 3: Log in to Hugging Face using the API token
23
+ - name: Hugging Face Login
24
+ run: huggingface-cli login --token ${{ secrets.HF_TOKEN }}
25
+
26
+ # Step 4: Sync to Hugging Face Space
27
+ - name: Sync with Hugging Face Space
28
+ run: |
29
+ git push https://huggingface.co/${{ secrets.HF_USERNAME }}/DS553.git main