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 t
From GitHub support, 2014-06-07:
It's not currently possible to manually trigger a rebuild, without pushing a commit to the appropriate branch.
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>
Thanks to GitHub Actions, it's fairly easy to trigger a daily publish: https://stackoverflow.com/a/61706020/4548500.
This is doable as of v3 of the GitHub API, though it is currently in preview
https://developer.github.com/v3/repos/pages/#request-a-page-build
POST /repos/:owner/:repo/pages/builds
You may have received an email from GitHub telling you that Jekyll did not succeed at building your site when you pushed it to your gh-pages
. If this is the case, you can try to force push to trigger another build.
If you use a dedicated folder for the final website, let's say a public
folder, you can try to rebuild your folder and add the folder to your commited changes. After that, you'll need to split those file into your gh-pages
branch and force them to trigger another build even if the files did not change at all. The rest of the code bellow just removes the commits for the public
folder for convenience and removes it from the local filesystem.
git add public
git commit -am ":bug: triggering another jekyll build"
git push origin $(git subtree split --prefix public master):gh-pages --force
git reset HEAD~1
rm -rf public
If there are uncommited changes that are not part of the final site, you can stash them with the following command.
git stash
Then do the above command to manually force the Jekyll build and unstash them.
git stash pop