Publishing gh-pages with Travis-CI

The solution at nodemeatspace.com

language: node_js
node_js:
- '0.10'
script: npm run-script deploy
env:
global:
- GH_REF: github.com/knode/node-meatspace.git
- secure: RIbIq8hI153J5trRa........
npm install travis-encrypt -g
travis-encrypt -r [repository slug] -k GH_TOKEN -v [the token you created before]
.... 
"scripts": {
"deploy": "./deploy-ghpages.sh"
},
....
#!/bin/bash
rm -rf out || exit 0;
mkdir out;
node build.js
( cd out
git init
git config user.name "Travis-CI"
git config user.email "travis@nodemeatspace.com"
cp ../CNAME ./CNAME
cp ../countryiso.js ./countryiso.js
git add .
git commit -m "Deployed to Github Pages"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
)

Engineering Manager | Built @RisingStack, @GodaddyOSS @BaseWebReact | Find me at https://nemethgergely.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store