YamenRM commited on
Commit
bbacbdd
·
unverified ·
1 Parent(s): e6daf61

Update workflow to sync with Hugging Face

Browse files
Files changed (1) hide show
  1. .github/workflows/sync.yml +28 -15
.github/workflows/sync.yml CHANGED
@@ -1,16 +1,29 @@
1
- - name: Upload to Hugging Face
2
- env:
3
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
4
- run: |
5
- pip install huggingface_hub
6
- python - <<EOF
7
- from huggingface_hub import upload_folder
8
- import os
9
 
10
- upload_folder(
11
- folder_path='.',
12
- repo_id='YamenRM/workflow-analyzer',
13
- repo_type='space',
14
- token=os.environ['HF_TOKEN']
15
- )
16
- EOF
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face
 
 
 
 
 
 
 
2
 
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ sync-to-hub:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0
15
+
16
+ - name: Set up Git
17
+ run: |
18
+ git config --global user.email "actions@github.com"
19
+ git config --global user.name "github-actions"
20
+
21
+ - name: Add Hugging Face remote
22
+ env:
23
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
24
+ run: |
25
+ git remote add hf https://YamenRM:$HF_TOKEN@huggingface.co/spaces/YamenRM/workflow-analyzer
26
+
27
+ - name: Push to Hugging Face
28
+ run: |
29
+ git push -f hf main