(travis encrypt-file result)
Add the script to deploy.sh under scripts folder and also add deploy_key.enc to scripts folder. Append scripts/ to delopy_key and deploy_key in this script as follows,
openssl aes-256-cbc -K $encrypted_7562052d3e34_key -iv $encrypted_7562052d3e34_iv -in scripts/deploy_key.enc -out scripts/deploy_key -d Please do not to upload deploy_key.pub .
If it prompts login info, try
travis login Then you can push everything to the repository and Travis-CI will build and push things for you.
One more thing to note is that npm run deploy
in deploy.sh is used here which use gh-pages library to push code to gh-pages .
GitHub Webhook
(1st part Github Webhook)
(2nd part of Github Webhook)
Add a webhook in your project (1st part of Github Webhook) and you can specify when Github will send the request (2nd part of Github Webhook).
(app to receive Github Webhook Request)
Then you need to deploy a small app (pm2 is recommended to persist the app process) to respond to Github Webhook.
codePath is the path where accommodate production code from gh-pages branch.
updateCommand ,
cd ${codePath};sudo git fetch — all;sudo git reset — hard origin/gh-pages; is to fetch all stuff from gh-pages branch and only show the latest record.
Don’t forget to configure your nginx/apache to serve your static files in codePath.
Reference Auto-deploying built products to gh-pages with Travis
优质内容筛选与推荐 >>
1、redis 2、RNN学习资料 3、冒泡排序(2017-09-01) 4、关于文件 5、C语言 · 时间转换
长按二维码向我转账
受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。
阅读
好看
已推荐到看一看
你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
取消
分享想法到看一看
确定
最多200字,当前共 字