by meandavejustice

meandavejustice / gh-pages-deploy

publish to gh-pages from package.json

211 Stars 22 Forks Last release: Not found MIT License 41 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:



Deploy straight to github pages with one simple command.


# install it from npm and symlink it into your PATH
npm install gh-pages-deploy -g

now run it!


You can also use

npm run
to package it with your app without installing it globally.

First add this to your scripts section of

  "scripts": {
    "deploy": "gh-pages-deploy",
    "clean-source": "rimraf src webroot package.json"

And then install

as a devDependency:
npm install gh-pages-deploy --save-dev

And now you can run

npm run deploy
to run the
installed in the local
folder (even if you have never done
npm install gh-pages-deploy -g

You can also provide a custom commit message via command line argument:

  "scripts": {
    "deploy": "gh-pages-deploy -- 'A custom commit message'",


To configure

all you need to do is specify a couple of things in your
(all of which are optional)
  "gh-pages-deploy": {
    "staticpath": "dist",
    "cname": "",
    "prep": [
    "commit": "a custom commit message",
    "post": [
    "noprompt": false

  • "staticpath" path to your files to be copied over to the root directory
  • "cname" content for CNAME file
  • "prep" an array of script names to run before pushing to github, this can be any script that you have declared in your "scripts" object in your
  • "commit" a custom commit message to be used when committing to git
  • "post" an array of script names to run after "prep", but before add/commit/push
  • "noprompt" if this is set to true, the prompt will be bypassed and you will never need to confirm the commands before deploying.


This repo uses

. Checkout the gh-pages branch and the result at

This was inspired after a conversation with max ogden regarding the setup of the Code For Portland Jekyll Pages. Inspired by the repository, I wanted an easier way for people to generate static pages and deploy to github without being tied to just jekyll.



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.