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

gh-pages branch remains empty after push to master; pages build and deployment not triggered #62

Open
luz-ojeda opened this issue Mar 16, 2023 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@luz-ojeda
Copy link

luz-ojeda commented Mar 16, 2023

Hello. If I understand correctly (correct me if I don´t please), if I commit to master I should expect two actions to be triggered, the custom one from the yml file and the pages build and deployment from github itself right? I have created the yml workflow file under .github/workflows/, set up the deployment to be from gh-pages branch but when I commit to master, gh-pages remains empty so I get a 404 when I go to my pages url

This is how the repo pages section is configured:

image

Thanks in advance

@luz-ojeda
Copy link
Author

Fixed it. I had to configure Workflow permissions to "Read an write permissions" in the repo settings -> Actions -> General, to the bottom of the page. It was set to "Read repository contents and package permissions" by default.

image

@jeffreytse jeffreytse self-assigned this Mar 17, 2023
@jeffreytse jeffreytse added the good first issue Good for newcomers label Mar 17, 2023
@jeffreytse
Copy link
Owner

Hi @lezojeda

Thanks for your issue, and it's so glad to hear that you've solved the problem. And welcome to star this project for further update in the future.

Thanks & Regards

@AlexStormwood
Copy link

Can confirm, this was an issue for me and the change to permissions fixed this issue for me as well. It'd be worthwhile to put a note about this in the project's readme - it's the only hurdle that I had in getting this awesome action to work!

@indie-rok
Copy link

@lezojeda Made the trick! Thank you

@davidalpert
Copy link

davidalpert commented Jun 18, 2023

if you do not want to change the default workflow permissions you can also set permissions for this workflow alone.

add something like this permissions block to your workflow:

...

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest

    # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
    permissions:
      contents: write # read to check out code / write enables push to the configured branch (e.g. gh-pages)
      pages: write

    steps:
      - uses: actions/checkout@v2

     ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants