📝 Edit page
➕ Add page
GitHub Pages
Use plain Git to build and push
gh-pagesbranch
Assumptions:
- You want to push to the root of the
gh-pagesbranch. - Your GitHub repo is configured to serve the root of your
gh-pagesbranch. - Output directory is
build.
Rather than adding to a .sh script, add to Makefile.
- `Makefile
deploy: git worktree add /tmp/build gh-pages rm -rf /tmp/build/* cp -rp build/* /tmp/build/ cd /tmp/build \ && git add -A \ && git commit -m "ci: deploy on $(shell date) by ${USER}" \ && git push origin gh-pages
Then run this either locally or your CI steps such as on GitHub Actions.
$ make deploy
Based on guide.