Rupali Ravindra Shetye commited on
Commit
e2d61cd
·
1 Parent(s): 74480c3

Fix auto-deploy workflow with full history fetch

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yml +32 -0
.github/workflows/deploy.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to Hugging Face
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout code with full history
12
+ uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0 # This fixes the shallow update error
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: '3.11'
20
+
21
+ - name: Install Hugging Face CLI
22
+ run: |
23
+ pip install huggingface-hub
24
+
25
+ - name: Deploy to Hugging Face
26
+ env:
27
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
28
+ run: |
29
+ git config --global user.email "actions@github.com"
30
+ git config --global user.name "GitHub Actions"
31
+ git remote add hf https://ShetyeRupa:$HF_TOKEN@huggingface.co/spaces/ShetyeRupa/DocIntel
32
+ git push hf main --force