Skip to content

Run GitHub Pages only after PR merges - #6

Merged
aliorhun merged 1 commit into
mainfrom
ci/pages-on-pr-merge-only
Oct 6, 2026
Merged

aliorhun merged 1 commit into
mainfrom
ci/pages-on-pr-merge-only

Conversation

@aliorhun

@aliorhun aliorhun commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Changes

  • add an explicit GitHub Pages workflow
  • trigger it only on pull_request: closed for main
  • run the deploy job only when github.event.pull_request.merged == true
  • direct commits/pushes do not trigger this workflow
  • closing a PR without merging creates no build/deploy job
  • deploy the static index.html with actions/upload-pages-artifact + actions/deploy-pages

Required repository setting

The repository is currently using GitHub's dynamic branch-based Pages workflow (dynamic/pages/pages-build-deployment). That workflow is controlled by the Pages setting, not by files in the repo, and it will continue to run on every push to main until the source is changed.

After merging this PR, set:

Settings → Pages → Build and deployment → Source → GitHub Actions

Once that is switched, only this merge-only workflow will deploy Pages.

@aliorhun
aliorhun merged commit cd26989 into main Oct 6, 2026

This branch had an error being deployed

1 failed deployment
github-pages — 998f5caa Deployed Oct 6, 2026 by aliorhun via deploy #1
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