Spaces:
Runtime error
Runtime error
Update workflow to sync with Hugging Face
Browse files- .github/workflows/sync.yml +28 -15
.github/workflows/sync.yml
CHANGED
|
@@ -1,16 +1,29 @@
|
|
| 1 |
-
|
| 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 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|