Skip to content

Commit

Permalink
feat: add travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Apr 16, 2020
1 parent 1bedfde commit 01bd699
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: node_js
node_js:
- 'node'

branches:
only:
- master

install:
- npm ci
# keep the npm cache around to speed up installs
cache:
directories:
- "$HOME/.npm"

script: bash ./deploy.sh
env:
global:
- ENCRYPTION_LABEL: 29c04b622e97
- COMMIT_AUTHOR_EMAIL: yifeng.ruan@gmail.com
16 changes: 16 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails

# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in wangdoc-deploy-rsa.enc -out wangdoc-deploy-rsa -d
chmod 600 wangdoc-deploy-rsa
eval `ssh-agent -s`
ssh-add wangdoc-deploy-rsa

# Now that we're all set up, we can push.
# git push $SSH_REPO $TARGET_BRANCH
npm run build-and-commit
2 changes: 2 additions & 0 deletions loppo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ customization: false
themeDir: loppo-theme
direction: ltr
id: es6
hasComments: true
isTutorial: true
Binary file added wangdoc-deploy-rsa.enc
Binary file not shown.

0 comments on commit 01bd699

Please sign in to comment.