actions/configure-pages fails with 'Get Pages site failed'
Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub ActionsShort answer
configure-pages asks GitHub for the repository's Pages site. If Pages is not switched on with the GitHub Actions source, the call fails. In Settings, Pages, set Source to GitHub Actions, and give the job pages: write and id-token: write. The enablement input can turn Pages on, but it needs a token other than GITHUB_TOKEN.
Fix it fast
1Find out which cause you have
Read the full error line in the failed step. It names what the action tried (get or create) and prints the underlying message.
gh run view --log-failed | grep -i 'pages site'2Match what you see, then jump to its fix
- 1
Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub ActionsPages is not enabled, or its source is not GitHub ActionsFix - 2
The workflow has no permissions block, or one without pages and id-tokenThe job lacks the permissions a Pages workflow needsFix - 3
A new repository, Pages never switched on, and you do not want to click through SettingsYou want the workflow to enable Pages itselfFix
- 1
What does the error look like?
Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub ActionsCreate Pages site failedError: Get Pages site failed
Cause 1 of 3
Pages is not enabled, or its source is not GitHub Actions
1Check
Open the repository Settings, then Pages, and read the Source setting under Build and deployment.
gh api repos/OWNER/REPO/pages2Fix
Set Source to GitHub Actions (Settings, Pages, Build and deployment). Re-run the workflow.
# Settings > Pages > Build and deployment > Source: GitHub Actions
gh run rerun --failed3Verify
The configure-pages step passes and prints a base URL.
gh run view --log | grep -i base_urlConfirmed by docs.github.com
Cause 2 of 3
The job lacks the permissions a Pages workflow needs
1Check
The custom-workflow docs say the job needs at least pages: write and id-token: write. A restricted default token has neither.
grep -n -A6 'permissions:' .github/workflows/*.yml2Fix
Add the permissions to the deploy job (or the workflow).
permissions:
contents: read
pages: write
id-token: write3Verify
Re-run; the step no longer fails on access.
gh run rerun --failedConfirmed by docs.github.com
Cause 3 of 3
You want the workflow to enable Pages itself
1Check
configure-pages has an enablement input, default false. It tries to enable Pages, and it requires a token other than GITHUB_TOKEN.
grep -n -B2 -A6 'configure-pages' .github/workflows/*.yml2Fix
Store a personal access token (repo scope or Pages write) or a GitHub App token (administration:write, pages:write) as a secret and pass it with enablement: true. Switching Pages on once in Settings is usually simpler.
- uses: actions/configure-pages@v5
with:
enablement: true
token: ${{ secrets.PAGES_ADMIN_TOKEN }}3Verify
A first run creates the site; later runs can drop enablement.
gh api repos/OWNER/REPO/pages --jq .html_urlConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Switch Pages to the GitHub Actions source before the first deploy run.
- Keep pages: write and id-token: write only on the deploy job.
- Do not store an admin token only to automate a setting you change once.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
Docker push to Artifact Registry fails from GitHub Actions with a permission error
Permission 'artifactregistry.repositories.uploadArtifacts' denied on resource
The identity your workflow authenticates as lacks the permission artifactregistry.repositories.uploadArtifacts on the target repository.
4 causes, each with a fixServers
docker pull or push to ghcr.io fails with 'denied'
Error response from daemon: denied
ghcr.io refuses a pull or push when Docker is not logged in, when the token lacks the package scope, or when the workflow's GITHUB_TOKEN has no packages permission or no access to that package.
4 causes, each with a fixServers
git says it could not read Username for https://github.com in a build or CI job
fatal: could not read Username for 'https://github.com': No such device or address
Git asked for HTTPS credentials and there was no terminal to ask on, so it gave up.
3 causes, each with a fixServers
upload-artifact fails because the artifact storage quota is full
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
Uploads fail when your account's shared artifact storage is used up.
3 causes, each with a fixServers
configure-aws-credentials says no OpenID Connect provider exists for GitHub
No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com
AWS has no IAM identity provider for GitHub's token issuer in the account that holds the role.
3 causes, each with a fixServers
A local composite action in GitHub Actions cannot be found
The action folder is in the repository but the runner reports that its action.yml cannot be found
A local action is read from the checked-out repository.
3 causes, each with a fix