Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A workflow can use GITHUB_TOKEN to deploy a GitHub Pages artifact, but a commit pushed with that token will not trigger a Pages build. These are different operations: the token-trigger restriction applies when a workflow pushes a commit and expects that push to start another build; it does not rule out GitHub’s custom artifact-based Pages deployment.

Why a workflow-pushed commit does not rebuild Pages

GitHub documents that commits pushed by a GitHub Actions workflow using GITHUB_TOKEN do not trigger a GitHub Pages build. This affects workflows that generate files, commit them to a branch, and expect the resulting push event to publish the site. The commit can succeed while no Pages build starts.

This is an event-trigger limitation, not proof that the token cannot be used for any Pages deployment. GitHub describes two publishing approaches: publish from a branch, or use a custom GitHub Actions workflow. GitHub’s publishing-source documentation explains the choices, and its Pages creation guidance documents the token-pushed-commit behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the publishing flow that matches your build

Approach Where published files come from How publishing proceeds
Branch source The configured branch’s root or /docs folder Changes pushed to the selected source are published. A commit pushed by a workflow using GITHUB_TOKEN does not trigger a Pages build.
Custom Actions workflow A Pages artifact produced by the workflow The workflow builds the site as needed, uploads the artifact, and deploys it with actions/deploy-pages.

The branch option suits a site whose published files already live in the selected source location. A custom workflow suits a site that needs a build step before publication. For the latter, the expected sequence is build, upload the Pages artifact with actions/upload-pages-artifact, then deploy it with actions/deploy-pages. GitHub documents this pattern in Using custom workflows with GitHub Pages.

Can GITHUB_TOKEN deploy a Pages site?

Yes, the documented custom-workflow deployment path can use the workflow’s GitHub token permissions to deploy a Pages artifact. The deployment job needs at least pages: write and id-token: write, and it should depend on the job that built and uploaded the artifact. Those permissions authorize the artifact deployment flow; they do not make a later commit pushed with GITHUB_TOKEN trigger a separate Pages build.

GITHUB_TOKEN is a repository-scoped GitHub App installation access token created for each workflow job. GitHub recommends granting it only the permissions the job needs. See the official GITHUB_TOKEN overview and authentication guidance.

Diagnose the failure from the source setting and run

  1. Check the Pages source. In the repository’s Pages settings, determine whether publishing is configured for a branch or for GitHub Actions. The correct fix depends on that choice.
  2. For branch publishing, check the configured path. Confirm the selected branch and either its root or /docs folder exist and contain the expected site files. A missing /docs source can produce a Pages build error.
  3. Check what event was supposed to start publication. If a workflow committed generated files using GITHUB_TOKEN and expected that push to start another Pages build, that trigger will not occur.
  4. For a custom workflow, follow the artifact chain. Confirm the build output is uploaded as a Pages artifact, the deploy action runs after the build job, and the deployment job has both pages: write and id-token: write.
  5. Read the exact error and the Actions run. The token-trigger rule does not establish that every Pages error is a token error. The error text and run logs are needed to distinguish a missing source, failed build, missing artifact, permission issue, or another problem.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When another credential may be needed

Use a different credential only if the workflow must perform an operation that GITHUB_TOKEN cannot authorize. GitHub documents a GitHub App installation token or a personal access token stored as a repository secret for operations requiring unavailable permissions. That is not an automatic requirement for the standard Pages artifact deployment documented above. Review GitHub’s GITHUB_TOKEN authentication guidance before changing credentials.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.