pengqi commited on
Commit
020386c
·
unverified ·
1 Parent(s): 3cb0df3

Update sync-to-hf.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/sync-to-hf.yml +15 -9
.github/workflows/sync-to-hf.yml CHANGED
@@ -1,24 +1,30 @@
1
- name: Sync to Hugging Face
2
 
3
  on:
4
  push:
5
- branches:
6
- - main # 触发分支,按需修改
7
 
8
  jobs:
9
  sync:
10
  runs-on: ubuntu-latest
11
  steps:
12
- - name: Checkout code
13
  uses: actions/checkout@v4
 
 
14
 
15
- - name: Configure Git
16
  run: |
17
  git config --global user.name "GitHub Actions"
18
  git config --global user.email "[email protected]"
19
 
20
- - name: Add HuggingFace Remote
21
- run: git remote add hf https://dongsiqie:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/dongsiqie/q.git
 
22
 
23
- - name: Push to HuggingFace
24
- run: git push hf main --force
 
 
 
 
 
1
+ name: Force Sync to Hugging Face
2
 
3
  on:
4
  push:
5
+ branches: [main]
 
6
 
7
  jobs:
8
  sync:
9
  runs-on: ubuntu-latest
10
  steps:
11
+ - name: Checkout GitHub 代码(完整历史)
12
  uses: actions/checkout@v4
13
+ with:
14
+ fetch-depth: 0 # 关键!禁用浅克隆,拉取完整历史
15
 
16
+ - name: 配置 Git 身份
17
  run: |
18
  git config --global user.name "GitHub Actions"
19
  git config --global user.email "[email protected]"
20
 
21
+ - name: 添加 Hugging Face 远程仓库
22
+ run: |
23
+ git remote add hf https://dongsiqie:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/dongsiqie/q.git
24
 
25
+ - name: 强制推送覆盖 Hugging Face
26
+ run: |
27
+ # 禁用 LFS 验证(解决 remote: Unexpected internal error hook: lfs-verify)
28
+ git lfs uninstall
29
+ # 强制推送覆盖(关键命令)
30
+ git push hf main --force