Skip to content

Commit f21923b

Browse files
committed
chore: Allow forcing docs deployment
1 parent 905b08d commit f21923b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

duties.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,12 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
117117

118118

119119
@duty
120-
def docs_deploy(ctx: Context) -> None:
121-
"""Deploy the documentation to GitHub pages."""
120+
def docs_deploy(ctx: Context, *, force: bool = False) -> None:
121+
"""Deploy the documentation to GitHub pages.
122+
123+
Parameters:
124+
force: Whether to force deployment, even from non-Insiders version.
125+
"""
122126
os.environ["DEPLOY"] = "true"
123127
with material_insiders() as insiders:
124128
if not insiders:
@@ -135,6 +139,11 @@ def docs_deploy(ctx: Context) -> None:
135139
tools.mkdocs.gh_deploy(remote_name="upstream", force=True),
136140
title="Deploying documentation",
137141
)
142+
elif force:
143+
ctx.run(
144+
tools.mkdocs.gh_deploy(force=True),
145+
title="Deploying documentation",
146+
)
138147
else:
139148
ctx.run(
140149
lambda: False,

0 commit comments

Comments
 (0)