This repository has been archived by the owner on Jul 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build & deploy & notify without human
- Loading branch information
levy
committed
May 12, 2019
1 parent
403eb45
commit f341186
Showing
5 changed files
with
2,073 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
branches: | ||
only: | ||
- master | ||
language: node_js | ||
node_js: | ||
- lts/* | ||
git: | ||
depth: 3 | ||
env: | ||
- API_SERVER=https://easy-mock.com/mock/5c1b3895fe5907404e654045/femessage-mock PUBLIC_PATH=http://levy.work/nuxt-element-dashboard/ | ||
install: | ||
- yarn | ||
- yarn --frozen-lockfile | ||
script: | ||
- yarn build | ||
- ./build.sh | ||
after_success: | ||
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release | ||
- ./notify.sh | ||
cache: yarn | ||
deploy: | ||
provider: pages | ||
skip-cleanup: true | ||
keep-history: true | ||
local-dir: dist | ||
on: | ||
branch: master | ||
github-token: $GITHUB_TOKEN |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
yarn stdver | ||
|
||
yarn build | ||
|
||
git remote add github https://$GITHUB_TOKEN@github.com/levy9527/nuxt-element-dashboard.git > /dev/null 2>&1 | ||
git push github HEAD:master --follow-tags | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
url=https://api.github.com/repos/levy9527/nuxt-element-dashboard/releases/latest | ||
html_url=`curl $url | sed -n 5p | sed 's/\"html_url\"://g' | awk -F '"' '{print $2}'` | ||
body=`curl $url | grep body | sed 's/\"body\"://g;s/\"//g'` | ||
|
||
msg='{"msgtype": "markdown", "markdown": {"title": "新版本发布", "text": "@所有人\n# ['$html_url']('$html_url')\n'$body'"}}' | ||
|
||
curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg" | ||
|
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
Oops, something went wrong.