feat: add publish support

This commit is contained in:
ruanyf
2019-07-15 23:18:55 +08:00
parent 5e70419a8c
commit c77b4a0bd4
4 changed files with 31 additions and 0 deletions

13
.travis.yml Normal file
View File

@@ -0,0 +1,13 @@
language: node_js
node_js:
- '10'
branches:
only:
- master
script: bash ./deploy.sh
env:
global:
- ENCRYPTION_LABEL: fcf2c626dda7
- COMMIT_AUTHOR_EMAIL: yifeng.ruan@gmail.com

16
deploy.sh Normal file
View File

@@ -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

View File

@@ -6,3 +6,5 @@ customization: false
themeDir: loppo-theme
direction: ltr
id: html
hasComments: true
isTutorial: true

BIN
wangdoc-deploy-rsa.enc Normal file

Binary file not shown.