Closed JeremyMcCormick closed 3 months ago
Just a question for long term maintenance: what happens when the branch/PR disappear? The corresponding version still stays on the server. Maybe it should be removed when the branch disappear, isn't it?
The versions would just stay there. We leave them on Rubin, as you can see here, for example.
If we decide that they should be deleted after the corresponding PR is merged to main
, that is something I could look at doing in another PR. I don't have a strong preference either way.
Ok. I did not want to say we should, but more that it is something we may have to just think now (and later, we can perform the decided action, if needed). But sure, it is perfectly OK with me to do that, if necessary, in another PR ; that's exactly what I had in mind when approving this PR :wink:
This updates the Github actions so that pull requests will deploy the branch's version of the website to
v/${BRANCH_NAME}
under the main site. The base URL is specified using the-b
command line argument tohugo
so that links correctly point to the branch version site instead of the main one.The Github action files were renamed to be clearer and more concise. The
build_main
action will update the main site on merges tomain
. Thebuild_version
action deploys a pull request's branch changes as described above. The steps for the main workflow were simplified, as the versioned sites are deployed using a totally separate action now, and the dry-run configuration was no longer required.Additionally, I have added a Github action to setup the
hugo
tool by downloading and adding it to a cache, so that it can be reused in different workflows without requiring setup from scratch every time.Changes were tested on this branch where I verified that the links look correct and point to the versioned site instead of the main site.
The new, simplified workflow for deploying the main site won't trigger until the PR is merged.