Enable a GitHub Pages project site from `main` + `/docs`
To host generated static documentation for a project, configure GitHub Pages to Deploy from a branch with main as the source branch and /docs as the source folder.
Steps (GitHub UI):
- Push your static site files to the repository under
docs/(entry point isdocs/site/index.html). - In the repository, open Settings.
- In the sidebar, open Pages.
- Under Build and deployment, set Source to Deploy from a branch.
- Set Branch to
mainand Folder to/docs. - Click Save.
- Wait for the Pages deployment to complete (a GitHub Actions workflow starts automatically).
- Open the site URL.
You can also configure a custom domain in Pages settings.
Official docs: