-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 2.18 KB
/
hf-space.yml
File metadata and controls
58 lines (52 loc) · 2.18 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Sync to HuggingFace Space
on:
workflow_run:
workflows: ["Deploy Visual Report to GitHub Pages"]
types: [completed]
branches: [main]
workflow_dispatch:
jobs:
deploy:
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: hf-space
# When triggered by the Pages workflow, download its build artifact
- name: Download site artifact
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: site-content
path: _site
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
# When triggered manually, fetch the published site
- name: Fetch published site
if: github.event_name == 'workflow_dispatch'
run: |
mkdir -p _site/grasp _site/g1-reach _site/g1-loco \
_site/g1-native-groot _site/g1-native-sonic _site/sonic-planner _site/sonic
BASE=https://miaodx.com/roboharness
curl -fsSL "$BASE/" -o _site/index.html
curl -fsSL "$BASE/grasp/index.html" -o _site/grasp/index.html
curl -fsSL "$BASE/g1-reach/index.html" -o _site/g1-reach/index.html
curl -fsSL "$BASE/g1-loco/index.html" -o _site/g1-loco/index.html
curl -fsSL "$BASE/g1-native-groot/index.html" -o _site/g1-native-groot/index.html
curl -fsSL "$BASE/g1-native-sonic/index.html" -o _site/g1-native-sonic/index.html
curl -fsSL "$BASE/sonic-planner/index.html" -o _site/sonic-planner/index.html
curl -fsSL "$BASE/sonic/index.html" -o _site/sonic/index.html
- name: Add Space metadata
run: cp hf-space/README.md _site/README.md
- name: Mirror site to Hugging Face Space
uses: huggingface/hub-sync@v0.1.0
with:
github_repo_id: MiaoDX/roboharness
subdirectory: _site
huggingface_repo_id: miaodongxu/roboharness-demo
hf_token: ${{ secrets.HF_TOKEN }}
repo_type: space
space_sdk: static