seismic-anisotropy / PyDRex

Simulate crystallographic preferred orientation evolution in polycrystals
https://seismic-anisotropy.github.io/PyDRex/
GNU General Public License v3.0
3 stars 2 forks source link

build: Only deploy docs for latest tag #207

Closed adigitoleo closed 3 months ago

adigitoleo commented 3 months ago

This brings us one step towards having docs for every tagged version. For now (after the next tag push) there should only be one website for the latest tagged version. Earlier versions can be built offline. Progress to #199.

In any case, it is better than the current situation: html documentation is being deployed for every single push on main, and the docs website did not indicate a version number anywhere. With these GH workflow adjustments, the docs should still be built for each PR/push to main, allowing to catch errors in the documentation setup as they arise, but the html pages will not deployed to GitHub Pages if there is no tag. The version (obtained from git describe) is also indicated clearly on the website landing page and in the API docs sidebar footer.

Related things that I rolled in here:

adigitoleo commented 3 months ago

docs should still be built for each PR/push to main

Obviously not happening. Either need to split docs.yml into docs-build.yml and docs-deploy.yml, or somehow get the conditionals to work properly in docs.yml.

Edit: Maybe fixed by having two jobs in the same yml? I think the if-check that stops deployment if we are not on a tag should only block the deploy job now, but let the check-html-build job run. But I'm not sure why it still didn't run the Github Pages action at all on top of b2f7d77.

adigitoleo commented 3 months ago

I just realised that based on this log maybe I don't need to duplicate the common job steps after all (b2f7d77). I guess the if-check in L63 of docs.yml only evaluates after the "Build" task has completed, so even if we aren't on top of a tag it should still check that make html works before aborting. I can remove that commit after review.