hp commited on
Commit
980a4d8
·
unverified ·
1 Parent(s): 0ffb9c0

Create deploy.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yml +42 -0
.github/workflows/deploy.yml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to HuggingFace Spaces
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - dev
8
+
9
+ jobs:
10
+ deploy:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v3
16
+ with:
17
+ fetch-depth: 0
18
+ lfs: true
19
+
20
+ - name: Determine target space
21
+ id: target
22
+ run: |
23
+ if [ "${{ github.ref }}" == "refs/heads/main" ]; then
24
+ echo "space=yuvabe-ai/yuvabe-app" >> $GITHUB_OUTPUT
25
+ echo "branch=main" >> $GITHUB_OUTPUT
26
+ else
27
+ echo "space=yuvabe-ai/yuvabe-app-dev" >> $GITHUB_OUTPUT
28
+ echo "branch=dev" >> $GITHUB_OUTPUT
29
+ fi
30
+
31
+ - name: Push to HuggingFace Space
32
+ env:
33
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
34
+ run: |
35
+ git config --global user.email "github-actions@github.com"
36
+ git config --global user.name "GitHub Actions"
37
+
38
+ # Add HuggingFace remote
39
+ git remote add hf https://user:$HF_TOKEN@huggingface.co/spaces/${{ steps.target.outputs.space }}
40
+
41
+ # Push to HuggingFace Space
42
+ git push hf ${{ steps.target.outputs.branch }}:main --force