ci(pages): auto-enable Pages site on first deploy#27
Merged
Conversation
The initial deploy failed with 'Get Pages site failed: Not Found' because Settings → Pages had not been configured yet. Set actions/configure-pages 'enablement: true' so the action creates the Pages site on the fly, and grant the build job 'pages: write' so the Pages API call is authorised. Run that failed: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942
mborchuk
added a commit
that referenced
this pull request
May 26, 2026
The initial deploy failed with 'Get Pages site failed: Not Found' because Settings → Pages had not been configured yet. Set actions/configure-pages 'enablement: true' so the action creates the Pages site on the fly, and grant the build job 'pages: write' so the Pages API call is authorised. Run that failed: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942
mborchuk
added a commit
that referenced
this pull request
May 26, 2026
* ci(pages): auto-enable Pages site on first deploy The initial deploy failed with 'Get Pages site failed: Not Found' because Settings → Pages had not been configured yet. Set actions/configure-pages 'enablement: true' so the action creates the Pages site on the fly, and grant the build job 'pages: write' so the Pages API call is authorised. Run that failed: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942 * screenshots * pages * ci(pages): auto-enable Pages site on first deploy (#27) The initial deploy failed with 'Get Pages site failed: Not Found' because Settings → Pages had not been configured yet. Set actions/configure-pages 'enablement: true' so the action creates the Pages site on the fly, and grant the build job 'pages: write' so the Pages API call is authorised. Run that failed: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first run of
Deploy GitHub Pagesfailed at the Configure Pages step:Run: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942
Cause:
actions/configure-pagesdefaults toenablement: false, which expects the Pages site to already exist (Settings → Pages → Source = GitHub Actions). On a fresh repo it doesn't, so the API call returns 404.Fix
enablement: trueonactions/configure-pagesso the action auto-creates the Pages site on the first run.pages: writeto the build job so the Pages API call is authorised. Top-level workflow permissions stay atcontents: read.After this lands, the workflow will create the Pages site and proceed to build + deploy. No manual UI step required.
Verification
.github/workflows/pages.yml.security.ymlis unchanged.