Github pages verify deployment before merging to main branch

Has anyone created a workflow with github pages to require successful deployment before merging to main brach? If so, are you willing to share? More specifically, I am imagining, a collaborator is required to create a new branch of a repo used to host a page on github pages, push changes to this other branch, and only after it is the equivalent of successfully deployed (as if it would have successfully built for a github pages), is the committer then allowed to do a pull request to the main branch for deployment of a github page. I’ve done this with a collaborative latex project (collaborators changes must be successfully run via pdflatex to compile a document before they are allowed to pull request to main), but I have not found the equivalent for hugo github page.