noke / .github /workflows /sync-hf.yml
i3t2y
ci: HF sync workflow with file exclusions via deploy branch
bbd8be7
Raw
History Blame Contribute Delete
1.14 kB
name: Sync to HuggingFace Spaces
on:
push:
branches: [main]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config --global user.email "i3t2y@users.noreply.github.com"
git config --global user.name "i3t2y"
- name: Create HF-only branch without excluded files
run: |
git checkout -b hf-deploy
# 删除 docs 目录(排除整目录)
git rm -r docs/ || true
# 删除其他非运行时文件
git rm config.json.example || true
git rm routes/debug_probe.py || true
git rm core/image_upload.py || true
git rm .agents/skills/noke-proxy/SKILL.md || true
git commit -m "chore: HF Space deploy - exclude non-runtime files" --allow-empty || true
- name: Push to HuggingFace
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git remote add hf https://noxke:${HF_TOKEN}@huggingface.co/spaces/noxke/noke || true
git push hf hf-deploy:main --force