GitHub Pages deploy fails in configure-pages: no site exists or token is refused

The actions/configure-pages step fails when it asks the REST API for a repository's Pages site, and the error's HTTP code shows the cause. A Not Found response means the repository has never had a Pages site created, which is typical for new, forked, or template-based repositories. A 403 response means the token was refused, often because it lacks permission to administer the repository. Creating the site once, by selecting GitHub Actions as the source in settings or via the API, resolves the first case. Setting enablement to true needs a token other than the default GITHUB_TOKEN, and it will not fix a 403 by itself.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in