forked from huangxd-/danmu_api
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.01 KB
/
Copy pathsync_hf.yml
File metadata and controls
36 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Sync to Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync-to-huggingface:
runs-on: ubuntu-latest
if: ${{ vars.ENABLE_HF_SYNC == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Prepare Hugging Face README
run: |
cp README.hf.md README.md
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "准备 Hugging Face Space 元数据" --allow-empty
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ vars.HF_USERNAME }}
HF_SPACE_NAME: ${{ vars.HF_SPACE_NAME }}
run: |
git remote add hf "https://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME}"
git push --force hf HEAD:main