Skip to content

ci(pages): auto-enable Pages site on first deploy#27

Merged
mborchuk merged 1 commit into
mainfrom
fix/pages-enablement
May 23, 2026
Merged

ci(pages): auto-enable Pages site on first deploy#27
mborchuk merged 1 commit into
mainfrom
fix/pages-enablement

Conversation

@mborchuk
Copy link
Copy Markdown
Owner

Problem

The first run of Deploy GitHub Pages failed at the Configure Pages step:

Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions
HttpError: Not Found

Run: https://github.com/mborchuk/ContaAutonomo/actions/runs/26338667942

Cause: actions/configure-pages defaults to enablement: 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

  • Set enablement: true on actions/configure-pages so the action auto-creates the Pages site on the first run.
  • Grant pages: write to the build job so the Pages API call is authorised. Top-level workflow permissions stay at contents: read.

After this lands, the workflow will create the Pages site and proceed to build + deploy. No manual UI step required.

Verification

  • YAML parses cleanly.
  • Diff is +12 lines, isolated to .github/workflows/pages.yml.
  • security.yml is unchanged.

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 mborchuk merged commit c8e6ccc into main May 23, 2026
7 checks passed
@mborchuk mborchuk deleted the fix/pages-enablement branch May 23, 2026 17:17
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant