Docusaurus deploy
How to use docusaurus with github pages?
-
npx create-docusaurus@latest folder_name
- Change organization name, project name etc.
- Add gh-pages deployment branch, trailingslah:true
-
yarn install
-
yarn build
- Create personal access token or SSH setup
- Deploy
USE_SSH=true yarn deploy
-
GIT_USER=<gh_personal_access_token> yarn deploy
- Change github repository page view main to gh-pages from repository
settings -> pages(left sidebar) -> branch
'gh-pages
and/root
than save.
How to update?
-
yarn build
USE_SSH=true yarn deploy
- or
-
GIT_USER=<gh_personal_access_token> yarn deploy
If you want to add new blog, docs
- You are gonna use main branch to add new pages.
- gh-pages only using for static web view.
- You need to build and deploy again.
Additional Resource
- Docusourus Github page
- Tutorial guide