-
Add new content in
docs/folder. -
Run
git addto add relevant changes. -
Run
git committo commit the changes made. -
Run
git pushto push the changes. -
Run
mkdocs gh-deployto deploy the page.
-
mkdocs gh-deployfirst builds the project and creates a directory namedsite/. -
Contents of the
site/directory is then copied to a branch namedgh-pages. (this directory can be gitignored). -
This branch is then pushed to github.
-
In github project
settings->Pagesoption, you can see that the branchgh-pagesis used to deploy your static site.
-
gitignore
site/directory -
No matter from which branch the
mkdocs gh-deploycommand is run, thesite/directory will get copied to thegh-pagebranch and gets deployed as a site.