Upload the branch version of the website for pull requests #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.