Selcan Yukcu commited on
Commit
882bbbb
·
1 Parent(s): c772733

feat: revise deployment workflow to force push clean history to Hugging Face Space

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yml +22 -12
.github/workflows/deploy.yml CHANGED
@@ -1,19 +1,29 @@
1
- name: Sync with Hugging Face Hub
2
 
3
  on:
4
  push:
5
- branches:
6
- - main
7
 
8
  jobs:
9
- build:
10
  runs-on: ubuntu-latest
11
  steps:
12
- - name: Sync with Hugging Face
13
- uses: nateraw/huggingface-sync-action@v0.0.4
14
- with:
15
- github_repo_id: lokumai/defect_solver_mcp_server
16
- huggingface_repo_id: dnext/ds-mcp-server
17
- repo_type: space
18
- space_sdk: gradio
19
- hf_token: ${{ secrets.HF_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face Hub
2
 
3
  on:
4
  push:
5
+ branches: [main]
 
6
 
7
  jobs:
8
+ sync-to-hub:
9
  runs-on: ubuntu-latest
10
  steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0 # Full history required
15
+ lfs: true
16
+
17
+ - name: Configure Git
18
+ run: |
19
+ git config --global user.email "actions@github.com"
20
+ git config --global user.name "GitHub Actions"
21
+
22
+ - name: Force push clean history to HF Space
23
+ env:
24
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
25
+ HF_SPACE_ID: ${{ vars.HF_SPACE_ID }}
26
+ run: |
27
+ git remote add hf "https://api:$HF_TOKEN@huggingface.co/spaces/$HF_SPACE_ID"
28
+ git fetch hf
29
+ git push hf main --force