The following steps occur to trigger a workflow run:
...
GitHub searches the .github/workflows directory in your repository for workflow files that are present in the associated commit SHA or Git ref of the event.
So, the workflow file is expected to be present in the gh-pages branch for it to run.
In this PR:
This is done because according to GitHub Docs:
So, the workflow file is expected to be present in the gh-pages branch for it to run.