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

docs build workflow #36

Merged
merged 7 commits into from
Oct 4, 2024
Merged

docs build workflow #36

merged 7 commits into from
Oct 4, 2024

Conversation

mbsabath
Copy link
Contributor

@mbsabath mbsabath commented Oct 3, 2024

closes #33

Builds docs on push to all non-main branches

On dev, pushes built docs to github pages

@mbsabath mbsabath self-assigned this Oct 3, 2024
@mbsabath
Copy link
Contributor Author

mbsabath commented Oct 3, 2024

May be blocked until sphinx rtd theme 3.0.0 is released per this issue: readthedocs/sphinx_rtd_theme#1598

Edit: Found a work around, but we should update the dependency once 3.0.0 is officially released

run: |
source .venv/bin/activate
which sphinx-build
make build-docs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this edit the doc files? Do you need to commit and push this somehow? This discussion has an example workflow where they commit and push the changes induced by a script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm intentionally not pushing the built html docs to the Repo. My thinking is that it could add a lot of noise of extra changes as the html files come in, and could potentially make small changes look much bigger than they are, since they're effectively a build artifact rather than source code if that makes sense. Do you have a strong opinion on including the built html files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the html files are not added to the repo, where are they added to? How do we edit the docs if we want to add notes that can't be immediately deduced from the source code?

Copy link
Contributor

@timothyngo timothyngo Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe I'm just somewhat confused by what this workflow captures. Does it just convert the markdown files in docs/ to documentation on github pages? Why does this step run if the head_ref is not dev?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this runs always to make sure that any changes don't cause the documentation build to break. However, we only push the changes to a separate gh-pages branch when it is dev that is changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care if the documentation build breaks if it is a PR to something that is not dev or main? I'll approve since this isn't something I'd block on, but I often build multiple PRs chaining on each other to make it clear what steps are involved in a big change, and I wouldn't expect docs to be built on prematurely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what you're saying, I can update this so it runs on pushes to dev/PRs to dev only

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it set up to only run on PRs to dev

Copy link
Contributor

@timothyngo timothyngo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make sure that the built docs are included in the PR after the workflow is run, RE my comment above.

@mbsabath mbsabath merged commit 1b1aa96 into dev Oct 4, 2024
2 checks passed
@mbsabath mbsabath deleted the iss33_build_dev_docs branch October 4, 2024 18:21
@mbsabath mbsabath restored the iss33_build_dev_docs branch October 4, 2024 18:33
mbsabath added a commit that referenced this pull request Oct 17, 2024
* docs build workflow

* use https git repo for sphinxrtd

* use release archive for rtd theme

* explicitly use sphinx make

* activate venv before building docs

* fix build output dir

* only run on PRs/pushes to dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build dev documentation on github pages
3 participants