Search code examples
github-pages

How to force GitHub Pages build?


Every GitHub repository can have (or be) a GitHub Pages website, that can be built with Jekyll. GitHub builds the site every time you push a new commit.
Is there a way to force the refresh of the Github Pages website without pushing a new commit?


Solution

  • From GitHub support, 2014-06-07:

    It's not currently possible to manually trigger a rebuild, without pushing a commit to the appropriate branch.


    Edit:

    As Andy pointed out in the comments, you can push an empty commit with the command:

    git commit -m 'rebuild pages' --allow-empty
    git push origin <branch-name>
    

    Edit 2:

    Thanks to GitHub Actions, it's fairly easy to trigger a daily publish: https://stackoverflow.com/a/61706020/4548500.