Last active
November 25, 2015 16:25
-
-
Save jcouyang/81ae59d10c15572c79d8 to your computer and use it in GitHub Desktop.
Circle CI Github Page and NPM deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x -e | |
git clone [email protected]:$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 "[email protected]" | |
git config --global user.name $CIRCLE_PROJECT_USERNAME | |
git add . | |
git commit -m "publi:ship: $CIRCLE_BUILD_NUM" | |
git push origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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