Skip to content

Commit 0d93d29

Browse files
committed
docs: deploy via GitHub Action + wrangler
1 parent f71a8bc commit 0d93d29

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy docs to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'scripts/docs/**'
9+
- 'roboverse_pack/tasks/**'
10+
- '.github/workflows/deploy-docs.yml'
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: deploy-docs
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
cache: pip
29+
cache-dependency-path: docs/requirements.txt
30+
31+
- name: Install docs dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install -r docs/requirements.txt
35+
36+
- name: Build roboverse.wiki
37+
run: bash scripts/docs/build_roboverse_wiki.sh public
38+
env:
39+
METASIM_REF: main
40+
41+
- name: Deploy to Cloudflare Pages
42+
uses: cloudflare/wrangler-action@v3
43+
with:
44+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
45+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
46+
command: pages deploy public --project-name=roboverse-release --branch=main

docs/README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,31 @@ This is due to some files are automatically generated in `source/dataset_benchma
2727

2828
## Cloudflare Pages deployment
2929

30-
Cloudflare Pages should build the static docs without installing the RoboVerse Python package. Set the Pages build variable `SKIP_DEPENDENCY_INSTALL=1` so Cloudflare skips the automatic `pip install .` phase, which otherwise downloads simulator/runtime packages such as `torch`.
30+
The site is deployed via the `.github/workflows/deploy-docs.yml` GitHub
31+
Action, which builds in CI and uploads the static `public/` directory to
32+
the Cloudflare Pages project `roboverse-release` with
33+
`wrangler pages deploy`. Cloudflare itself is **not** asked to build —
34+
this avoids its framework auto-detection running `pip install .` against
35+
the repository's `pyproject.toml`, which would otherwise pull in `torch`,
36+
`metasim` (with all of its sim/runtime deps), and friends.
3137

32-
Use this build command:
38+
Required GitHub repository secrets:
39+
40+
- `CLOUDFLARE_API_TOKEN` — token with `Account → Cloudflare Pages → Edit`
41+
- `CLOUDFLARE_ACCOUNT_ID` — the Cloudflare account ID hosting the Pages project
42+
43+
In the Cloudflare Pages dashboard for `roboverse-release`, disable the
44+
git integration's build (or set Build command + Build output directory
45+
to empty) so Cloudflare doesn't shadow-build on every push. The project
46+
should be set to receive deployments via Direct Upload only.
47+
48+
The workflow triggers on `push` to `main` when `docs/`, `scripts/docs/`,
49+
or `roboverse_pack/tasks/` changes, plus manual `workflow_dispatch`.
50+
51+
To reproduce the build locally:
3352

3453
```bash
35-
python -m pip install --upgrade pip && python -m pip install -r docs/requirements.txt && bash scripts/docs/build_roboverse_wiki.sh public
54+
python -m pip install --upgrade pip
55+
python -m pip install -r docs/requirements.txt
56+
bash scripts/docs/build_roboverse_wiki.sh public
3657
```
37-
38-
Set the build output directory to `public`.

0 commit comments

Comments
 (0)