With https://gohugo.io/host-and-deploy/host-on-github-pages/#article, this part --baseURL "${{ steps.pages.outputs.base_url }}/ added the repo name to the URL causing thousands of my links to break e.g https://example.com/foo became https://example.com/lorem/foo with lorem as repo name Google search console sent me a warning. This happened a few months ago, and I had to hard code the base URL.
There is conflicting information as to how this should work. Or to put it another way, it is unclear to me if the build phase is aware of the custom domain setup. The deploy phase is, but that would be too late to populate steps.pages.outputs.base_url correctly.
If it were my site, I’d remove the --baseURL flag from the GItHub action, and instead make sure that the baseURL in my site config is correct.
That’s not a very satisfying answer, but anything more would require some testing that I don’t have time for at the moment.