katospiegel commited on
Commit
be20f62
·
1 Parent(s): fb05b8e

feat: CI to push main into HF Space

Browse files
Files changed (1) hide show
  1. .github/workflow/push_to_hf.yml +32 -0
.github/workflow/push_to_hf.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Push to Hugging Face on PR merge
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+
7
+ jobs:
8
+ push_to_huggingface:
9
+ if: github.event.pull_request.merged == true
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v3
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: '3.8'
20
+
21
+ - name: Install Hugging Face Hub
22
+ run: pip install huggingface-hub
23
+
24
+ - name: Authenticate to Hugging Face
25
+ run: huggingface-cli login --token ${{ secrets.HF_TOKEN }}
26
+
27
+ - name: Push to Hugging Face
28
+ run: |
29
+ python -m huggingface_hub.cli upload_folder \
30
+ --repo-id SDSC/digiwild \
31
+ --path "./" \
32
+ --branch main