withastro / action

A GitHub Action that deploys your Astro project to GitHub Pages
Other
153 stars 34 forks source link

Fix missing GitHub Pages configuration #11

Closed nickserv closed 2 years ago

nickserv commented 2 years ago

Without this, using actions/deploy-pages on a repository will fail unless the user has manually configured GitHub Pages to use GitHub Actions in the repository's settings:

Run actions/deploy-pages@v1
  with:
    emit_telemetry: false
    token: ***
    timeout: 600000
    error_count: 10
    reporting_interval: 5000
    artifact_name: github-pages
    preview: false
Actor: nickmccurdy
Action ID: 3140963899
Artifact URL: https://pipelines.actions.githubusercontent.com/RangmLWb4A3Oh85B6ExrP3mk5Yp9xD[2](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:2)k9gPmCCk1FiqoJaAxM7/_apis/pipelines/workflows/[3](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:3)1[4](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:4)0963899/artifacts?api-version=6.0-preview
{"count":1,"value":[{"containerId":362[5](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:5)12,"size":10240,"signedContent":null,"fileContainerResourceUrl":"https://pipelines.actions.githubusercontent.com/RangmLWb4A3Oh85B[6](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:6)ExrP3mk5Yp9xD2k9gPmCCk1FiqoJaAxM[7](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:7)/_apis/resources/Containers/362512","type":"actions_storage","name":"github-pages","url":"https://pipelines.actions.githubusercontent.com/RangmLWb4A3Oh[8](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:8)5B6ExrP3mk5Yp[9](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:9)xD2k9gPmCCk1FiqoJaAxM7/_apis/pipelines/1/runs/1/artifacts?artifactName=github-pages","expiresOn":"2022-09-29T05:07:33.3367337Z","items":null}]}
Creating deployment with payload:
{
    "artifact_url": "https://pipelines.actions.githubusercontent.com/RangmLWb4A3Oh85B6ExrP3mk5Yp9xD2k9gPmCCk1FiqoJaAxM7/_apis/pipelines/1/runs/1/artifacts?artifactName=github-pages&%24expand=SignedContent",
    "pages_build_version": "5a3a8554a440ee8d9250db866fb7c02902ca27e6",
    "oidc_token": "***"
}
Error: Request failed with status code 404
    at createError (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/node_modules/axios/lib/core/createError.js:16:1)
    at settle (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/node_modules/axios/lib/core/settle.js:17:1)
    at IncomingMessage.handleStreamEnd (/home/runner/work/_actions/actions/deploy-pages/v1/webpack:/deploy-pages/node_modules/axios/lib/adapters/http.js:293:1)
    at IncomingMessage.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1343:[12](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:13))
    at processTicksAndRejections (node:internal/process/task_queues:83:[21](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:22))
Error: Failed to create deployment (status: 404) with build version 5a3a8554a440ee8d9[25](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:26)0db866fb7c02902ca[27](https://github.com/nickmccurdy/astro-cross-platform/actions/runs/3140963899/jobs/5102905501#step:2:28)e6. Ensure GitHub Pages has been enabled.
nickserv commented 2 years ago

This appears to still be broken, but I'm not sure why.

natemoo-re commented 2 years ago

Alright, this definitely doesn't work! I reverted your change, but looks like I can't reopen this PR. Please open a new PR and we'll try to get to the bottom of this!

natemoo-re commented 2 years ago

Thanks for bringing this action to my attention @nickmccurdy! I had no idea it was an option.

Left a comment on the configure-pages repo to see if we need to upstream something to get this working without any setup.