gh-pages
Publish static sites to GitHub Pages branch
TLDR
Deploy dist folder to gh-pages
SYNOPSIS
gh-pages [options]
DESCRIPTION
gh-pages is an npm package that publishes files to a GitHub Pages branch. It automates pushing built static sites to the gh-pages branch for hosting, creating clean commits of your distribution folder to the target branch.
The tool makes deployment a single command and is commonly used in CI/CD pipelines and as a package.json script.
PARAMETERS
-d, --dist dir
Directory to deploy.-s, --src pattern
File pattern within dist.-b, --branch branch
Target branch (default: gh-pages).-o, --remote remote
Remote name (default: origin).-m, --message msg
Commit message.-u, --user name
Git user name.-e, --email email
Git user email.-a, --add
Add files, don't remove existing.-t, --dotfiles
Include dotfiles.--nojekyll
Add .nojekyll file.
CONFIGURATION
package.json
Configure a deploy script with `"deploy": "gh-pages -d dist"` in the scripts section.
CAVEATS
Requires git and npm. Overwrites target branch. GitHub Pages settings must be configured. May need --nojekyll for some sites. Credentials needed for push.
HISTORY
gh-pages was created by Tim Schaub to simplify GitHub Pages deployments. It became a standard tool in the JavaScript ecosystem for static site deployment.
