Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in Guide -> Deployment -> GitHub Pages does not work with GitHub Actions #1021

Open
suchja opened this issue May 17, 2024 · 2 comments

Comments

@suchja
Copy link

suchja commented May 17, 2024

I tried the example as defined here and it seems not to work out of the box. From my tests (I'm no expert with GitHub Actions and GitHub Pages at all) it seems that there is an issue with the permissions.

From what I understood so far, probably the following needs to be added to the Deploy Site - GitHub Action script on the bottom of the page:

permissions:
  contents: write
  pages: write

Additionally as stated in this discussion it looks like the deployment via the pipeline does no longer work with the instructions from the Guide.

I would be willing to update the Guide as soon as it is clarified what exactly the problem is.

@daveaglick
Copy link
Member

That would be awesome if you do happen to narrow down the problems you're seeing to the guide, to update the guide directly - or even just let me know what the final finding is and I'll go in and make the updates. Definitely don't want anyone else to stumble on the same problem you had if it can be avoided.

@suchja
Copy link
Author

suchja commented May 22, 2024

The minimal required permission is contents: write. Without this permission dotnet run fails with an unspecific error around [WARN] Deployment/Output » ExecuteIf » ExecuteIf » DeployGitHubPages » GitHub exception ForbiddenException (retry 1/5, waiting 00:00:30): Resource not accessible by integration.

Additionally it is important to mention that the gh-pages branch (or the branch used for deployment) needs to exists BEFORE the deployment is started. Otherwise something like this [WARN] Deployment/Output » ExecuteIf » ExecuteIf » DeployGitHubPages » GitHub exception NotFoundException (retry 1/5, waiting 00:00:30): Not Found can be seen.

suchja added a commit to suchja/statiq-website-example that referenced this issue May 22, 2024
suchja added a commit to suchja/statiq-website-example that referenced this issue May 22, 2024
While debugging for statiqdev/Statiq.Web#1021 I realized that the GitHub Action is much faster on ubuntu compared to windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants