Skip to content

Commit 900991d

Browse files
committed
Revert "Remove obsolete post-generation message"
This reverts commit c897075.
1 parent 7f763fd commit 900991d

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

hooks/post_gen_project.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
_EXIT_SUCCESS = 0
88

99

10-
def main(initialise_git_repository: str) -> int:
10+
def main(initialise_git_repository: str, deploy_docs_to_github_pages: str) -> int:
1111
"""
1212
Create a git repository on generation of the project.
1313
1414
Args:
1515
initialise_git_repository: Whether to initialise the repo
16+
deploy_docs_to_github_pages: Whether to deploy built docs to GitHub Pages
1617
1718
Returns:
1819
The return code of the process
@@ -83,8 +84,30 @@ def main(initialise_git_repository: str) -> int:
8384
# some other error
8485
print(f"There was an error with the GitHub CLI: {e.returncode}\n{e.stderr}")
8586
return _EXIT_FAILURE
87+
if deploy_docs_to_github_pages == "True":
88+
print(
89+
"The 'Documentation' GitHub Actions workflow has been set up to push the "
90+
"built HTML documentation to a branch gh-pages on pushes to main for "
91+
"deploying as a GitHub Pages website. To allow the GitHub Actions bot to "
92+
"push to the gh-pages branch you need to enable 'Read and write "
93+
"permissions' under 'Workflow permissions' at\n\n"
94+
"{{cookiecutter.__repo_url}}/settings/actions\n\n"
95+
"After the 'Documentation' workflow has successfully completed at least "
96+
"once you will also need to configure the repository to deploy a GitHub "
97+
"pages site from the content on the gh-pages branch by going to\n\n"
98+
"{{cookiecutter.__repo_url}}/settings/pages\n\n"
99+
"and under 'Built and deployment' selecting 'Deploy from a branch' for "
100+
"the 'Source' drop-down and 'gh-pages' for the 'Branch' drop-down, "
101+
"leaving the branch path drop-down with its default value of '/ (root)'."
102+
)
103+
86104
return _EXIT_SUCCESS
87105

88106

89107
if __name__ == "__main__":
90-
sys.exit(main("{{ cookiecutter.initialise_git_repository }}"))
108+
sys.exit(
109+
main(
110+
"{{ cookiecutter.initialise_git_repository }}",
111+
"{{ cookiecutter.deploy_docs_to_github_pages }}",
112+
)
113+
)

0 commit comments

Comments
 (0)