ci(pages): split build from deploy, and build on pull requests - #4
Merged
Conversation
This workflow ran only on main and had a single build-and-deploy job, so a pull request got no signal at all -- and the job could not simply be guarded, because guarding it would have skipped the build too, leaving the pull request exactly as blind as before. So split it: build checks out, sets up Hugo, configures Pages, builds and uploads the artifact; deploy waits on it and runs only for push or workflow_dispatch. A pull request now builds the site and stops there, which is the whole point. Nothing else changes. The pinned versions are untouched -- checkout@v4, actions-hugo@v3 with hugo 0.130.0, configure-pages@v5, upload-pages-artifact@v3, deploy-pages@v4 -- as is `hugo --minify --gc` and the existing concurrency group. Bundling a version bump into a structural change would make both harder to judge. Verified before pushing: hugo 0.130.0, the pinned version, builds this tree locally, and actionlint reports nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 workflow ran only on main and had a single
build-and-deployjob, so a pull request got no signal at all — and the job could not simply be guarded, because guarding it would have skipped the build too, leaving the pull request exactly as blind as before.So split it:
build— checkout, set up Hugo, configure Pages, build, upload the artifact. Runs onpushandpull_request.deploy—needs: build, andif: github.event_name == 'push' || github.event_name == 'workflow_dispatch'.A pull request now builds the site and stops there, which is the whole point.
Nothing else changes. The pinned versions are untouched —
checkout@v4,actions-hugo@v3with hugo0.130.0,configure-pages@v5,upload-pages-artifact@v3,deploy-pages@v4— as ishugo --minify --gcand the existing concurrency group. Bundling a version bump into a structural change would make both harder to judge.Verified before pushing: hugo 0.130.0, the pinned version, builds this tree locally;
actionlintreports nothing.This was the last of 114 repositories in a measured sweep — of the 1118 with a green default-branch lane, 1000 already gated pull requests and 118 did not — and the only one whose workflow had to be restructured rather than simply gated.