While you can select a folder as the source for gh-pages, you can only do so for the /docs
directory at the parent level, and you still have to actually commit the built files in order to do so, which means you'll have to override the .gitignore
and commit them twice
<img src="https://i.stack.imgur.com/ggDJH.png" width="313"/>
Automated Deploy Scripts
If you're using npm, there are a couple packages that handle publishing sub-directories to gh-pages. Install with option --save-dev
to add it to your devDependencies
:
In either case, if get a command line tool working for you and get it configured with the right options, you can alias it in your package.json
like this:
<!-- language: lang-js -->
"scripts": {
"deploy": "npm run build && gh-pages -d dist"
}
Further Reading: