lyffseba commited on
Commit
a023908
·
1 Parent(s): 28bf38c

Add GitHub Action to sync with Hugging Face

Browse files
Files changed (1) hide show
  1. .github/workflows/sync-to-hf.yml +31 -0
.github/workflows/sync-to-hf.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ # to run this workflow manually from the Actions tab
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ sync-to-hub:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+ lfs: true
17
+ - name: Push to hub
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: |
21
+ # Configure Git
22
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
23
+ git config --global user.name "github-actions[bot]"
24
+
25
+ # Add the Hugging Face repository as a remote
26
+ # Change <YOUR_HF_USERNAME> to your actual Hugging Face username!
27
+ # Type can be "spaces", "models", or "datasets". We use "models" here.
28
+ git remote add huggingface https://user:$HF_TOKEN@huggingface.co/models/<YOUR_HF_USERNAME>/dexter
29
+
30
+ # Force push to the Hugging Face remote
31
+ git push -f huggingface main