GitHub Pages deployment
Configure GitHub Pages workflow deployment and docs metadata for fastship sites.
Run ship-pages once in a repository to write .github/workflows/docs.yml (when absent), enable workflow-based GitHub Pages via the GitHub API, set the repository homepage and [project.urls].Documentation, and register [project.entry-points.fastship] for Python packages.
ship-pages
ship-pages --runner macos-latest
fastws_docs_install
def fastws_docs_install(
proj:str, # Package name in `pyproject.toml`
)->str: # Shell install command for `fastws` maturin projects in CI
Return the CI install snippet for a fastws-backed maturin project.
docs_workflow
def docs_workflow(
rust:bool=False, # Include Rust toolchain and sccache settings for maturin/PyO3 projects
install:str=None, # Optional custom install shell script (`""` skips package installation)
runner:str='ubuntu-latest', # GitHub Actions runner label (e.g. `"macos-latest"`)
action:str='AnswerDotAI/workflows/ship-docs@master', # Composite GitHub Action building and deploying docs
)->str: # Rendered `.github/workflows/docs.yml` YAML text
Build the .github/workflows/docs.yml workflow YAML for GitHub Pages deployment.
wf = docs_workflow()
assert 'pages: write' in wf and 'ubuntu-latest' in wf
ship_pages
async def ship_pages(
token:str=None, # GitHub token (else `$FASTSHIP_TOKEN`, `./token`, or `$GITHUB_TOKEN`)
runner:str='ubuntu-latest', # GitHub Actions runner label (e.g. `"macos-latest"`)
)->str: # Published GitHub Pages URL
Configure GitHub Pages Actions docs deployment and enable Pages on the GitHub repository.
Creates .github/workflows/docs.yml when absent (adding Rust or fastws install steps for maturin projects). Enables GitHub Pages with build_type="workflow" (updating existing legacy Pages sites on HTTP 409), sets the repository homepage, fills [project.urls].Documentation if unset, and adds [project.entry-points.fastship] for Python packages.