Skip to content

docs(hy_worldplay): add HY-WorldPlay WAN-5B I2V model card #1335

docs(hy_worldplay): add HY-WorldPlay WAN-5B I2V model card

docs(hy_worldplay): add HY-WorldPlay WAN-5B I2V model card #1335

Workflow file for this run

name: Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
# `merge_group` fires when a PR enters GitHub's merge queue. Runs the
# docs build against the queue's temporary `gh-readonly-queue/main/...`
# ref so the doc check is satisfied without publishing.
merge_group:
branches: [main]
release:
types: [created]
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: astral-sh/setup-uv@v4
# The doc build only needs `flashdreams` to be importable. The heavy
# GPU stack (transformer-engine, pynvml, cv2, mediapy, boto3/botocore)
# is mocked via `autodoc_mock_imports` in `docs/source/conf.py`, so we
# install only the Sphinx toolchain + a minimal CPU-only dep set.
- name: Install dependencies
env:
# Pull torch/torchvision from PyTorch's CPU-only index.
UV_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
UV_INDEX_STRATEGY: unsafe-best-match
run: |
uv sync --only-group docs --only-group docs-ci --python 3.12
uv pip install --no-deps ./flashdreams
# Read version from `flashdreams/flashdreams/_version.py` (the single
# source of truth) so we can deploy under `versions/<version>/` on
# releases (mirrors gsplat's layout).
- name: Get version + subdirectory
run: |
VERSION=$(python -c "import re, pathlib; m=re.search(r'__version__\s*=\s*\"([^\"]+)\"', pathlib.Path('flashdreams/flashdreams/_version.py').read_text()); print(m.group(1))")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DOCS_SUBDIR=versions/$VERSION" >> $GITHUB_ENV
# On pushes to main *or* manual workflow_dispatch runs, render the
# version banner as `main` and deploy under `main/` instead of
# `versions/<x.y.z>/`. Releases keep the version-pinned subdir.
- name: Override version + subdirectory for main / manual builds
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
sed -i 's/^__version__ = ".*"/__version__ = "main"/' flashdreams/flashdreams/_version.py
echo "DOCS_SUBDIR=main" >> $GITHUB_ENV
- name: Sphinx build
# --no-project: the "Override version" step above rewrites the version
# field to "main" which is not PEP 440 compliant. Without --no-project
# uv would try to parse the workspace pyproject.toml and fail.
run: |
uv run --no-project sphinx-build -b html docs/source _build
- name: Prune Sphinx cache artifacts from publish dir
# Prevent Sphinx cache/metadata from being published to gh-pages.
run: |
rm -rf _build/.doctrees
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
# Only publish for real landings on main, releases, or manual runs —
# never from `pull_request` previews or `merge_group` queue runs.
if: github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
destination_dir: ${{ env.DOCS_SUBDIR }}
keep_files: false # only erases the destination subdirectory
# Uncomment + set if you wire up a custom domain later:
# cname: docs.flashdreams.nvidia.com
# Maintain root-level files on the gh-pages branch in a single clone:
# - `.nojekyll` — disables Jekyll so Sphinx's _static/ assets are
# served verbatim (Jekyll skips files/dirs that
# start with `_`).
# - `index.html` — redirects the bare site URL to /main/ so visitors
# landing on `https://<owner>.github.io/<repo>/`
# see the latest docs instead of a 404.
# - `versions/index.txt` (release-only) — flat list of released versions
# for a future version-picker widget (mirrors gsplat).
# Idempotent: only commits whatever pieces were actually missing/new.
- name: Maintain gh-pages root (index.html, .nojekyll, versions/index.txt)
# Mirrors the deploy gate: only touch `gh-pages` for real landings,
# not for `pull_request` previews or `merge_group` queue runs.
if: github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
run: |
set -e
# Shallow-clone gh-pages so we touch the branch only once per run.
tmp=$(mktemp -d)
git clone --depth=1 --branch=gh-pages \
"https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$tmp"
cd "$tmp"
changed=0
# Disable Jekyll so Sphinx's _static/ assets are served verbatim.
if [ ! -f .nojekyll ]; then
touch .nojekyll
changed=1
fi
# Root redirect → /main/ so the bare site URL lands on latest docs.
if [ ! -f index.html ]; then
cat > index.html <<'HTML'
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>flashdreams docs</title>
<meta http-equiv="refresh" content="0; url=./main/">
<link rel="canonical" href="./main/">
</head>
<body>
Redirecting to <a href="./main/">./main/</a>.
</body>
</html>
HTML
changed=1
fi
# Releases also append the new version to a flat index file
# for a future version-picker widget.
if [ "${{ github.event_name }}" = "release" ]; then
mkdir -p versions
touch versions/index.txt
if ! grep -qx "$VERSION" versions/index.txt; then
echo "$VERSION" >> versions/index.txt
changed=1
fi
fi
# Single push (or none) covering whichever pieces we actually added.
if [ "$changed" -eq 1 ]; then
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# `versions/index.txt` only exists on release runs; tolerate its absence.
git add .nojekyll index.html versions/index.txt 2>/dev/null || git add .nojekyll index.html
git commit -m "Maintain gh-pages root (index.html, .nojekyll, versions/index.txt)"
git push origin gh-pages
else
echo "gh-pages root already up to date; nothing to commit."
fi