Skip to content

Commit

Permalink
feat: add CI function
Browse files Browse the repository at this point in the history
  • Loading branch information
QC-L committed Dec 28, 2017
1 parent a81e1a7 commit f5608d3
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 4,124 deletions.
25 changes: 25 additions & 0 deletions .ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SOURCE_BRANCH="cn"

if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
echo "Skipping deploy; just doing a build and linting links/prose/js."
# skip fetching loaders/plugins in cn version
# npm run fetch
npm run build
# npm run lint:prose
# npm run lint:links
# npm test
exit 0
fi

npm run build

git config --global user.name "Travis CI"
git config --global user.email "[email protected]"
git remote set-url origin [email protected]:docschina/vuejs.org.git

openssl aes-256-cbc -K $encrypted_7933be997dd9_key -iv $encrypted_7933be997dd9_iv -in .ci/deploy_key.enc -out .ci/deploy_key -d
chmod 600 .ci/deploy_key
eval `ssh-agent -s`
ssh-add .ci/deploy_key

npm run deploy
Binary file added .ci/deploy_key.enc
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules/
public/
.deploy*/
src/_drafts
.avoscloud/
.avoscloud/
package-lock.json
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
branches:
only:
- cn
language: node_js
node_js:
- "8"
script:
- bash ./.ci/deploy.sh
sudo: required
install:
- npm install
7 changes: 4 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ markdown:

# Deployment
## Docs: http://zespia.tw/hexo/docs/deployment.html
# deploy:
# type: git
# repository: [email protected]:vuejs/vuejs.org.git
deploy:
type: git
repository: [email protected]:docschina/vuejs.org.git
branch: gh-pages

feed:
type: atom
Expand Down
Loading

0 comments on commit f5608d3

Please sign in to comment.