david-oplatka commited on
Commit
a56a1c2
·
unverified ·
1 Parent(s): 24de7c1

Create sync.yml

Browse files

Create GitHub Action to sync all Hugging Face spaces with the base repository's files.

Files changed (1) hide show
  1. .github/workflows/sync.yml +32 -0
.github/workflows/sync.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face Spaces
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ sync-to-hub:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ space_name: [company-pet-policy, about-mls] # List your Hugging Face space names here
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v3
18
+ with:
19
+ fetch-depth: 0
20
+ lfs: true
21
+
22
+ - name: Configure Git
23
+ run: |
24
+ git config --global user.email "[email protected]"
25
+ git config --global user.name "GitHub Actions"
26
+
27
+ - name: Push to Hugging Face
28
+ env:
29
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
30
+ run: |
31
+ git remote add space https://huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git
32
+ git push --force https://huggingface.co/spaces/david-oplatka:[email protected]/spaces/david-oplatka/${{ matrix.space_name }} main