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.)

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


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}}"
          "${{ github.repository }}/pages/builds"

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

@bwvolleyball, I used t public_repo scope, but if your repo is a private repo you might need the whole repo scope.


Now, I tested deployment with github_token using the GitHub Pages Action on some public repositories. It looks working well…

I do not know any official announcement of the GitHub starts to support triggering the GitHub Pages build event using GITHUB_TOKEN on public repositories…


Yup, I can confirm on my end that the GITHUB_TOKEN secret works for deploying code on the gh-pages branch.

You can view a relevant commit where I reverted the current token (a PAT) to the GITHUB_TOKEN secret here and the deployment run here.

1 Like

Looks like a Personal Access Token is not required anymore to trigger a page build on a public repository. Everything seems to work for me on several repositories with the built-in GITHUB_TOKEN using :

name: website

on: push

    runs-on: ubuntu-latest
        name: Checkout
        uses: actions/checkout@v1
        name: Build
        run: |
          mkdir public
          cat > public/index.html <<EOL
          <!doctype html>
              <title>GitHub Pages deployed!</title>
              <p>GitHub Pages with <strong>${{ github.sha }}</strong> commit ID has been deployed through <a href="">GitHub Pages action</a> successfully.</p>
        name: Deploy
        if: success()
        uses: crazy-max/ghaction-github-pages@v1
          target_branch: gh-pages
          build_dir: public
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 Like

To visitors,

This problem has been already fixed about 3 months ago.

Now, the GITHUB_TOKEN works well for deploying to GitHub Pages on public repositories and private repositories.

- uses: peaceiris/actions-gh-pages@v3
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public

1 Like