Skip to content

Instantly share code, notes, and snippets.

@jcouyang
Last active November 25, 2015 16:25
Show Gist options
  • Save jcouyang/81ae59d10c15572c79d8 to your computer and use it in GitHub Desktop.
Save jcouyang/81ae59d10c15572c79d8 to your computer and use it in GitHub Desktop.
Circle CI Github Page and NPM deploy
general:
branches:
only:
- master
machine:
node:
version: 5.0.0
dependencies:
pre:
- npm install -g babel-cli
deployment:
production:
tag: /v\d.*/
commands:
- ./ci/npm-login.sh
- npm publish
pages:
tag: /example.*/
commands:
- ./ci/github_page.sh
#!/bin/bash
set -x -e
git clone git@github.com:$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git -b gh-pages public
cd examples/todomvc
npm install
npm run build
cd ../..
mkdir -p public/todomvc
cp examples/todomvc/public/* public/todomvc
cd public
git config --global user.email "oyanglulu@gmail.com"
git config --global user.name $CIRCLE_PROJECT_USERNAME
git add .
git commit -m "publi:ship: $CIRCLE_BUILD_NUM"
git push origin gh-pages
#!/bin/bash
set -o nounset
set -o errexit
npm login <<!
$NPM_USERNAME
$NPM_PASSWORD
$NPM_EMAIL
!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment