A generic workflow to build Sphinx documentation and deploy to gitHub Pages#76
A generic workflow to build Sphinx documentation and deploy to gitHub Pages#76Yaswant Pradhan (yaswant) wants to merge 124 commits into
Conversation
Co-authored-by: Yaswant Pradhan <2984440+yaswant@users.noreply.github.com>
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
Looks good on the whole, a couple of suggestions to help with debugging etc.
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
This all looks good to me now.
|
James Bruten (@james-bruten-mo) do you want to have a look at this as well? |
James Bruten (james-bruten-mo)
left a comment
There was a problem hiding this comment.
I've got one minor change request to rename one of the variables pushed to github_env.
I guess I'm not completely convinced by this as a change. In the repos we manage, we'll be replacing a handful of relatively simple workflows with a single huge and complicated ones - I'm not sure that in this case, we're increasing maintainability?
I also really don't like the use of python throughout. Effectively we've got inline python, within a bash script, within a yaml file, which is something that you can do, but I'm not convinced we should. I'm not suggesting that it be rewritten as bash, but maybe it'd be better storing in a separate python file and just calling that?
The workflow seems reasonably impressive in many ways - I just worry that it's a little too complicated to be increasing maintainability (not to mention if it does break, all repos will be affected rather than just one at the moment). If you want to keep pursuing, then sure, but just noting some concerns.
| id: detect-makefile | ||
| run: | | ||
| if [ -f "${{ inputs.docs-dir }}/Makefile" ]; then | ||
| echo "found=true" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
I suggest found should be something more explicit here, found_makefile if nothing else
There was a problem hiding this comment.
done.
I understand your views and myself thought about keeping the scripts part separate (e.g., .github/scripts). But that will make the use of reusable workflow more complex when called from a forked PR unless we explicitly handle the checkout process . Keeping the messy python bit inline is guaranteed to work without additional work. If you could test a few edge cases where you think this might fail, that would be great |
|
James Bruten (@james-bruten-mo) thanks for the review and for some critical points James raised. It made me think again! So, I've made some changes to address some concerns:
Andrew Coughtrie (@andrewcoughtrie) thanks for the discussion around ubuntu-slim runner offline. This is a perfect choice for sphinx-build on our private repositories. I've tested few configurations here: https://github.com/MetOffice/git_playground/pull/136 |
PR Summary
Code Reviewer: James Bruten (@james-bruten-mo)
closes #34
A generic reusable workflow to build and deploy sphinx-based documentation with minimal effort.
Code Quality Checklist
AI Assistance and Attribution
sphinx-docs/README.mdwere enhanced with assistance from Met Office Github Copilot Enterprise and I have followed the Simulation Systems AI policyCode Review