github-actions commited on
Commit
8e97fd6
·
1 Parent(s): 27f1578

Fix shallow clone issue: add fetch-depth: 0 to checkout2

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yml +26 -0
.github/workflows/deploy.yml CHANGED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to Hugging Face
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0 # ← THIS IS THE CRITICAL FIX
14
+
15
+ - name: Setup Git
16
+ run: |
17
+ git config --global user.name "github-actions"
18
+ git config --global user.email "github-actions@github.com"
19
+
20
+ - name: Deploy to Hugging Face
21
+ run: |
22
+ # Add Hugging Face remote with token authentication
23
+ git remote add huggingface https://${{ secrets.HF_USERNAME }}:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/${{ secrets.HF_USERNAME }}/ci-cd-anomaly-detection
24
+
25
+ # Push to Hugging Face with full history
26
+ git push huggingface main --force