-
Notifications
You must be signed in to change notification settings - Fork 102
#29 GitHub actions to automate documentation site build on new release #100
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
base: develop
Are you sure you want to change the base?
#29 GitHub actions to automate documentation site build on new release #100
Conversation
@doyajii1 do you mind reviewing this one when you get a chance? |
@dimtsap These are great effort to automate doc site build! I will add points I think we need to change but feel free to ask/discuss on this together. |
run: | | ||
echo "Tag: ${{ steps.get_tag.outputs.tag }}" | ||
|
||
- name: Extract version without "v" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to pick out just major version strings like "v0.1", "v0.2" instead of v0.1.2, v0.2.1 from TAGs. I can imagine we could have a python script to filter them out and send to $GITHUB_OUTPUT
variable but unsure if there is a better way. If we can handle this up in the front, I hope that the other steps should overwrite to same major release doc site folder when the minor release gets pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can define internally your version strategy for the documentation that would be really helpful. The initial issue stated that the documentation should be triggered on new releases, this is why I used the current approach. Please let me know which versions you want to display and how the gh-pages branch should behave (folder structure, file replacement etc) to adjust it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimtsap Thank you for continuing to work on this! :) I think your current PR folder structure looks good; it's just that we want to track up to the minor releases for the documentation site, such as "v0.1", "v0.2", ..., "v0.#". I hope there is a way to overwrite the minor release folder whenever a patch tag is pushed.
I was thinking more along the following lines, but I'm unsure if it sounds possible to make it work:
- A push happens for
v*
tags. - The
Show tag
step runs as it is. - The
Set up Python
step runs to set up the Python script executable environment. - A Python script extracts the version name up to the minor digit at a new
Extract version without "v"
step. - The rest of the steps use the minor digit folder name. (Maybe delete and write a new one?)
Is it sounded possible?
.github/workflows/documentation.yaml
Outdated
run: | | ||
pip install poetry | ||
|
||
- name: Download and install Pandoc 3.7.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important but can we remove Pandoc version from the step name?
docs/Makefile
Outdated
# Get the parent dir name which is this docs' version | ||
VERSION := $(notdir $(CURDIR)) | ||
|
||
install: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that pyproject.toml
has the requirements.txt contents, can we remove install
? I think the github
and test local
can be updated in the other PR for fast local testing in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be possible to remove but I'll double check that.
Thank you for keeping all of docs dependencies versions as it is. We had some issues when people attempted to build doc site src on different python versions. |
@doyajii1 All changes you requested are implemented and work only for the minor version of documention like you asked. You can have a look at my example deployments here (https://dtsapetis.github.io/uqlm/latest/) Let me know if you have any other comments. |
@dimtsap Forgive me for checking so late at this, I will stay more tuned to give back feedback faster. Thank you for keep working through this PR. My explanation might have been confusing and forgive me on that part. The entire goal was basically can we just get v0.1, v0.2, v0.3, ... v#.# in the version selector dropdown without a file with list of version strings based on version tag. This is current version pattern in the drop down menu: I added this comment based on your newer build has pattern of v3.0, v3.1. Sorry for being so picky and difficult to have this move forward. Please don't get me wrong, I do feel your work is very close and very essential for the UQLM to avoid manual builds at every version release. |
@doyajii1 I am not sure I understand the comment you made above. The changes I propose automatically build the documentation based on the latest tag you publish. In addition the version.json is auto-updated so there is no need to maintain it manually. And to my understanding the version selector depends on such a file ( version.json)for the sphinx theme you have chosen. Could you please let me know which part of the process I have misunderstood to address it? |
@dimtsap thank you for the comment. I will try to show with example image. As of now the versions that I am seeing on your test site from forked repo is showing v3.1, v3.0. Our pattern is to keep track of v0.#. |
I looked back at your forked repo and realized that you have created tags on your forked repo which generated different version patterns. Can you test again just to ensure with same release tags? I believe your code and scripts should be good. It's just that your forked repo release tags are different to actual current UQLM release tags. What would be procedure to keep previous version docs? would it be something like recreate release tags? |
Hi @doyajii1. I recreated the releases of my repo so that the documentation looks similar to the one of yours. You can have a look at the result here: https://dtsapetis.github.io/uqlm/latest/ To keep the previous docs the only thing you need to do it to make you gh-pages look like that: What this means:
No other file is needed in the gh-pages branches. As you can see in the PR the docs are moved to the same branch as your code. You will not need to maintain multiple branches any more. Just update the docs when you need. And when you publish a new tag (make sure it has the pattern vMajor.Minor.Patch) the documentation will be updated automatically. Let me know if you have any other commnets or questions. |
@dimtsap All looks great! Thank you for your additional explanation and test.
After these add into the PR, it seems we are all ready @dylanbouchard and @mohitcek |
@dskarbrevik @dylanbouchard
I guess that took a bit longer than everyone expected but finally, I have the automated documentation github action ready for your review (#29). I have made some structural changes to how you build the docs so far so that you don't have to track multiple branches from now on. I will break down these changes as well as minor things that you will need to configure for this to work without any issues.
So let me begin with the major points:
For the minor issues:
Let me know if you have any comments or questions about the whole workflow.