Closed mdickinson closed 1 year ago
A couple of notes from an internal discussion:
graft_docs.py
to maintain that.graft_docs.py
lives at the top level of the repository. We could move both it and etstool.py
to a new ci
subdirectory. That would probably best be done in a separate PR, since it'll involve changing a good number of files (other workflows, README instructions, etc.) I considered moving it into .github
, but it's not really specific to the GitHub workflows, even though it's used by them.And two more thoughts:
graft_docs.py
should be renamed to something that clearly indicates it's related to maintaining the gh-pages
documentation.docs/
directory as a home for graft_docs.py
? We're already putting the documentation requirements file there.I've updated the branch protections for the gh-pages
branch to something that'll allow the workflows to push commits, but that should still protect us from accidental changes.
@corranwebster Thanks for review!
[...] we probably need to start enforcing that the docs build cleanly in every PR [...]
Yep, the test-doc-build.yml
workflow already does this for PR commits. The duplication between that and the two workflows in this PR is a little bit of a DRY violation, and could potentially be pulled out into a composite action.
[...] about the usefulness of having a "release"/"stable" or similar symlink [...]
I've updated this PR to add a "latest" symlink in 6677787f1c1cddda9c270a1e59c1a54fd0de63e0.
Do we want info@enthought.com here?
Sure, why not. Done in 2c7ab646a16795c3b464ae8ea0e53b91ae617f6b.
How about the docs/ directory as a home for graft_docs.py?
Done in fa666d083fadaed541a285f5d6be15c819e58d43
And apparently I managed to introduce a syntax error into the workflow the moment I stopped testing. Fixed in ebc60f9d6d0b3b628cbafeab7f925d92f62affc8.
This PR automates documentation building for the Envisage repository. It repurposes the current structure of the gh-pages branch, and adds workflows for updating documentation on every push to main and every release.
New gh-pages structure
The new gh-pages structure is as follows:
<major>.<minor>
numbered subdirectories (5.2
,6.0
,6.1
, etc.) contain documentation for released versions of EnvisageNote: as before, documentation for a bugfix release (e.g., Envisage 7.1.1) overwrites the documentation for the previous release (e.g., Envisage 7.1.0). This is deliberate - documentation bugs may be fixed in a bugfix release, but it should be rare for an API to change in a bugfix release, and for any given
<major>.<minor>
version number users should usually be seeing the latest documentation.Workflows
This PR adds two workflows for updating the docs:
update-gh-pages.yml
workflow updates the in-development docs on every push to themain
branch (i.e., every PR merge)update-gh-pages-on-release.yml
workflow updates the release docs on every published release.Both workflows use the new
graft_docs.py
script to do the work of copying the newly-built docs to the appropriate place in thegh-pages
branch.The workflows are very similar: the key differences between the two workflows are the triggers, and the passing of the
--tag
argument tograft_docs.py
in the release case. Otherwise, the workflows are essentially identical.Notes
I've created a branch
gh-pages-staging
for testing purposes; both workflows are currently pushing changes to that branch instead ofgh-pages
. When we're happy that this PR is working as intended, we should replacegh-pages-staging
withgh-pages
throughout. At the same time, we'll need to remove branch protections on thegh-pages
branch.To do after PR approval and prior to merge: