Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print out details of how to configure repository to allow deploying docs in post_gen_project.py hook #391

Closed
matt-graham opened this issue Jun 5, 2024 · 1 comment · Fixed by #404
Assignees
Labels
enhancement New feature or request

Comments

@matt-graham
Copy link
Collaborator

matt-graham commented Jun 5, 2024

Is Your Feature Request Related to a Problem? Please Describe

Currently if the deploy_docs_to_github_pages template option is set to y / True the documentation workflow will be set up to push the built documentation to a branch gh-pages to allow deploying on GitHub Pages however we only document that additional steps are required to get this working this in a comment in the workflow. Specifically the repository needs to be configured in https://github.com/{{owner}}/{{project_slug}/settings/pages to deploy GitHub Pages from the branch gh-pages (which will be created after first run of documentation workflow on push to main) and (which is not currently documented) the permissions for GitHub Actions workflows need to be changed for the repository to Read and write permissions in https://github.com/{{owner}}/{{project_slug}/settings/actions.

Describe the Solution You'd Like

  • Build on the current implementation of the post_gen_project hook which deals with the initialise_empty_git_repository template option to also output instructions to the user to update repository settings as above if deploy_docs_to_github_pages is set to True.

Describe Alternatives You've Considered

#205 suggests documenting next steps such as this - I'm assuming this means in the repository README? I think that would also be good to have but I think having something similar to the behaviour for initialise_empty_git_repository would be good.

Additional Context

No response

@matt-graham matt-graham added the enhancement New feature or request label Jun 5, 2024
@paddyroddy
Copy link
Member

#205 was just meant to be in some way, currently there's a fair bit we assume

@matt-graham matt-graham self-assigned this Jun 6, 2024
matt-graham added a commit that referenced this issue Jun 6, 2024
…404)

Fixes #391 

Adds some text to be printed out in `post_gen_project.py` hook when
`deploy_docs_to_github_pages` cookiecutter option is `True` to give
instructions on how to complete set up of deployment of HTML
documentation on GitHub Pages.

Example output:

```
Initialized empty Git repository in /home/matt/projects/test-package/.git/
GitHub CLI detected, you can create a repo with the following:

gh repo create matt-graham/test-package -d 'A cookiecutter package with UCL ARC recommendations.' --public -r origin --source test-package

The 'Documentation' GitHub Actions workflow has been set up to push the built HTML 
documentation to a branch gh-pages on pushes to main for deploying as a GitHub 
Pages website. To allow the GitHub Actions bot to push to the gh-pages branch you 
need to enable 'Read and write permissions' under 'Workflow permissions' at

https://github.com/matt-graham/test-package/settings/actions

After the 'Documentation' workflow has successfully completed at least once you will 
also need to configure the repository to deploy a GitHub pages site from the content 
on the gh-pages branch by going to

https://github.com/matt-graham/test-package/settings/pages

and under 'Built and deployment' selecting 'Deploy from a branch' for the 'Source' 
drop-down and 'gh-pages' for the 'Branch' drop-down, leaving the branch path 
drop-down with its default value of '/ (root).
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants