-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add a Github Action #21
Comments
Hey @goerz ; I'm far from an expert on any of this and sorry I never got around to providing feedback on drdoctr/doctr#351 ; though perhaps its for the better since I didn't hijack the thread further. With regard to getting a simple but working implementation online, since the dependency requirements are minimal have you considered whether a composite action would work, at least as a cheap initial prototype? It might not be quite as robust, but it would presumably be faster, much quicker and less complex to implement, and allow you to reuse your existing action steps. This is how we do it locally, but you'd have to test to confirm there isn't a reason why a remotely-hosted composite action wouldn't work, since I haven't tried that myself, and I'm not sure its a good idea long-term, but it could work as a stopgap at least. What you'd put in there really depends on how much you want to automate, vs. preserving flexibility for users. A minimal implementation would need to include the The build steps prior to this would naturally be up to the user, and the 4 bespoke deploy steps could be replaced with one of the Github Pages deploy actions, which provide similar (though not entirely identical) capabilities, sufficient for the vast majority of usecases and covering many features these bespoke ones do not (unless you really needed the fine-grained amend handling). Regarding your points on drdoctr/doctr#351
We had the same desire; we didn't want the deployment steps to run on However, I'm still a little confused as to the reasons for splitting the deploy workflow into two jobs and wrangling build artifacts between them, given this requires around 8-ish total extra steps and substantial additional runtime. The workflow only runs on a push to begin with, and you can set it to only run on release branches/tags with
Actually, unless I'm mistaken, you could replace the last four steps (including the quite complex second to last) with either of the popular Github pages deploy actions, with only a small loss in functionality (the custom commit amend handling beyond either amending or not, and a few prints). You could simply tell the actions to deploy your checkout of the deploy branch to which you rsynced the updated version and ran docs-versions-menu, either as a new commit or an amended one, and with a custom Github username, password and commit message. With those two changes alone, you'd condense two jobs and 22 steps down to 11 and one (and mostly the simpler ones), and that's without having to make a separate docs_version_menu action: checkout build branch, setup Python, apt install, pip install, build docs, checkout gh-pages branch, get branch name, rsync, set download links, run docs-versions-menu, deploy. A more typical user workflow, without the extra/bespoke steps, would be more like 8 steps, as apt install and set download links are not necessary for most use cases, and without them and the build artifact, the branch name is only needed one place. In that context, the minimal docs-versions-menu Github Action described above is of little net gain; depending on how configurable you want the env vars to be, it might simplify the docs-versions-menu step modestly to not at all, and only avoids one extra dep in the initial |
With the demise of Travis (#13), Github Actions is the default option for continuous integration. As of the recent renaming of the project from
doctr-versions-info
todocs-versions-info
, the project is in fact using Github Actions to deploy its own documentation. However, the steps in the action are rather involved:docs_versions_menu/.github/workflows/docs.yml
Lines 45 to 142 in 1d50949
The question has come up why it's necessary to go through all these steps instead of deploying to
gh-pages
with an existing action. The reason is thatdoctr-versions-menu
has to run on thegh-pages
branch. Certainly, thedeploy-to-github-pages
action can handle all aspects uploading the Sphinx documentation togh-pages
. It does for Github Actions what Doctr did for Travis. However, it does not have the equivalent of Doctr's--command
option that would allow to rundocs-versions-menu
on thegh-pages
branch.Thus, we we will have to create our own action for running
doctr-versions-menu
. The action is going to similar to the existing deploy actions.In principle, Github Actions can be Docker or Javascript (Typescript) based. Typescript is faster and runs on more platforms. Hence, the
deploy-to-github-pages
action is written in Typescript. Unfortunately, I don't know Typescript, so this is a non-starter.There is one action,
actions-gh-pages
, that was Docker-based in an older version 2. This seems like an excellent staring point to develop adocs-versions-menu
action.The action would simply run
docs-versions-menu
on thegh-pages
branch, thus turning the entire job into two steps (deploying to github, and runningdocs_versions_menu
)The text was updated successfully, but these errors were encountered: