Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 21 of 27

Re: Github action not triggering gh-pages upon push

 

    - name: Deploy
      uses: peaceiris/actions-gh-pages@v2.8.0
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PUBLISH_BRANCH: master
        PUBLISH_DIR: ./public
      with:
        keepFiles: true

 

 

I modify my  configuration here , now it is success. You should add  SSH deploy key following this :

https://github.com/marketplace/actions/github-pages-action#1-add-ssh-deploy-key

Highlighted
Copilot Lvl 3
Message 22 of 27

Re: Github action not triggering gh-pages upon push

@lovepoem, as commented in https://github.com/actions/checkout/issues/75#issuecomment-568468352, using a deployment key is not a solution, but an (uncomfortable) workaround. The default GITHUB_TOKEN allows to push changes to a branch of the same repo (which can be 'gh-pages'). The issue is on GitHub's deployment feature refusing to pick the commits pushed by the bot.

Pilot Lvl 1
Message 23 of 27

Re: Github action not triggering gh-pages upon push

Yes. Deployment key option is a current workaround better than a personal access token (PAT has too large scope). I hope that GitHub Pages build event can be triggered by GITHUB_TOKEN on a public repository. (GITHUB_TOKEN can trigger the event on a private repository.)

Highlighted
Copilot Lvl 3
Message 24 of 27

Re: Github action not triggering gh-pages upon push

Even the Personal Access Token seems to not trigger the update these days.

Highlighted
Copilot Lvl 3
Message 25 of 27

Re: Github action not triggering gh-pages upon push

Correct, just tried today with my personal token and the push is not trigering the build. I had to request a build manually using the GH API:

      - name: Request Github Pages build job
        run: >-
          curl -L -X POST 
          -H "Content-Type: application/json"
          -H "Authorization: token ${{ secrets.GH_PAT}}"
          "https://api.github.com/repos/${{ github.repository }}/pages/builds"
Highlighted
Copilot Lvl 2
Message 26 of 27

Re: Github action not triggering gh-pages upon push

@Xotl - when you manually used the GH API to request the pages build, which permission(s) did your personal access token require to work?

Highlighted
Copilot Lvl 3
Message 27 of 27

Re: Github action not triggering gh-pages upon push

@Bwvolleyball, I used tpublic_repo scope, but if your repo is a private repo you might need the whole repo scope.