Deploy to GitHub Pages
Published at Sep 14, 2024
Prerequisites Published at Sep 14, 2024
Prepare repository
- Fork this repository to your GitHub account.
- Clone your forked repository to your local development environment.
Prepare GitHub Pages
- Head to the
Settingstab of your forked repository and click on thePagessection. Then chooseGitHub Actionsas theBuild and deploymentsource.
Set up GitHub workflow
-
Head to the
Settingstab of your forked repository and click on theSecurity>Secrets and variables>Actions
-
Add the following variables by clicking on the
New repository variablebutton in theVariablestab.SITE_URL: The URL of your site. (if you have a custom domain, you can use it, otherwise you can use the one that Cloudflare provides you.)SITE_TITLE: The title of your site.SITE_DESCRIPTION: The description of your site.SITE_LANG: The language of your site. (e.g.en,zh-TW)
Note: If you want to use the url that GitHub provides you, it should be like this: https://<username>.github.io/<repository-name>/. Don’t forget to set theSITE_URLvariable to the whole URL including/<repository-name>/, or the page deployed will not work properly.