-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path.travis.yml
73 lines (60 loc) · 1.6 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
language: node_js
node_js:
- node
# Travis-CI Caching
cache:
yarn: true
npm: false
directories:
- node_modules
before_install:
- export TZ=Asia/Shanghai
# S: Build LifeCycle
install:
- npm install
# before_script:
script:
# - npm run eslint # 工程测试
# - npm run dev # 工程测试
# - npm run clean # 清除缓存
- npm run dist # 工程构建打包
- npm run gulp # 压缩
after_success:
# - git init
# 从远程拉取代码记录
- git clone https://${GITHUB_REPO} ./old-docs
- cd ./old-docs
# 检出远程分支
- git checkout -b gh-pages origin/gh-pages
- cd ../
- cp -r ./old-docs/.git ./public
# 编译目录
- cd ./public
- git config user.name "JoeyBling"
- git config user.email "2434387555@qq.com"
- git add -A
- git commit -m "deploy at `date +\"%Y-%m-%d %H:%M:%S\"`"
- git push --force --quiet "https://${CI_TOKEN_GITHUB}@${GITHUB_REPO}" gh-pages:gh-pages
# - git push --force --quiet "https://zhousiwei:${CI_TOKEN_GITEE}@${GITEE_REPO}" gh-pages:pages
git:
depth: false
branches:
only:
- master
# before_deploy:
# - yarn build
deploy:
# provider: pages
# github-token: $GITHUB_TOKEN # github 上的token环境变量
# local-dir: ./dist # 根据情况自定义到静态文件输出目录
# skip-cleanup: true
# 默认为gh-pages
# target-branch: gh-pages
# email: 2434387555@qq.com
# name: JoeyBling
# on:
# branch: master # 当master分支有push事件的时候执行deploy流程
env:
global:
- GITHUB_REPO: github.com/JoeyBling/yilia-plus-demo.git
- GITEE_REPO: gitee.com/zhousiwei/yilia-plus-demo.git