alamin655 commited on
Commit
3e14e93
1 Parent(s): f7f2362

Create deploy-hf.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy-hf.yml +35 -0
.github/workflows/deploy-hf.yml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face hub
2
+
3
+ on:
4
+ push:
5
+ branches: [hf-stable]
6
+
7
+ # to run this workflow manually from the Actions tab
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ sync-to-hub:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout Repository
15
+ uses: actions/checkout@v3
16
+ with:
17
+ fetch-depth: 0
18
+ lfs: true
19
+
20
+ - name: Configure Git
21
+ run: |
22
+ git config user.email "${{ secrets.EMAIL }}"
23
+ git config user.name "${{ secrets.USERNAME }}"
24
+
25
+ - name: Pull from Hugging Face Space
26
+ env:
27
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
28
+ run: |
29
+ git pull --allow-unrelated-histories https://alamin655:$HF_TOKEN@huggingface.co/spaces/alamin655/surfx main
30
+
31
+ - name: Push to Hugging Face Space
32
+ env:
33
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
34
+ run: |
35
+ git push https://alamin655:$HF_TOKEN@huggingface.co/spaces/alamin655/surfx hf-stable:main