Skip to content

Commit

Permalink
chore: Allow forcing docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 11, 2024
1 parent 905b08d commit f21923b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000


@duty
def docs_deploy(ctx: Context) -> None:
"""Deploy the documentation to GitHub pages."""
def docs_deploy(ctx: Context, *, force: bool = False) -> None:
"""Deploy the documentation to GitHub pages.
Parameters:
force: Whether to force deployment, even from non-Insiders version.
"""
os.environ["DEPLOY"] = "true"
with material_insiders() as insiders:
if not insiders:
Expand All @@ -135,6 +139,11 @@ def docs_deploy(ctx: Context) -> None:
tools.mkdocs.gh_deploy(remote_name="upstream", force=True),
title="Deploying documentation",
)
elif force:
ctx.run(
tools.mkdocs.gh_deploy(force=True),
title="Deploying documentation",
)
else:
ctx.run(
lambda: False,
Expand Down

0 comments on commit f21923b

Please sign in to comment.