Skip to content

ci(pages): split build from deploy, and build on pull requests - #4

Merged
tannevaled merged 1 commit into
mainfrom
ci/split-build-from-deploy
Aug 26, 2026
Merged

ci(pages): split build from deploy, and build on pull requests#4
tannevaled merged 1 commit into
mainfrom
ci/split-build-from-deploy

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

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 — checkout, set up Hugo, configure Pages, build, upload the artifact. Runs on push and pull_request.
  • deployneeds: build, and if: 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@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; actionlint reports 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.

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.
@tannevaled
tannevaled merged commit 16e287a into main Aug 26, 2026
2 checks passed
@tannevaled
tannevaled deleted the ci/split-build-from-deploy branch August 26, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant