jrrribeiro commited on
Commit
32f1ed1
·
1 Parent(s): 556e10f

ci: add GitHub Action to sync validator app to Hugging Face Space

Browse files
Files changed (1) hide show
  1. .github/workflows/sync-hf-space.yml +32 -0
.github/workflows/sync-hf-space.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync app to Hugging Face Space
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ sync-to-space:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0
18
+ lfs: true
19
+
20
+ - name: Push to Hugging Face Space
21
+ env:
22
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
23
+ HF_USERNAME: jrrribeiro
24
+ HF_SPACE_NAME: BirdNET-Validator-App
25
+ run: |
26
+ git config --global user.name "github-actions"
27
+ git config --global user.email "actions@github.com"
28
+ if [ -z "$HF_TOKEN" ]; then
29
+ echo "HF_TOKEN secret is required"
30
+ exit 1
31
+ fi
32
+ git push "https://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME}" HEAD:main --force