-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (45 loc) · 1.24 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
sudo: false
language: node_js
node_js:
- 14.18.3
cache:
apt: true
directories:
- node_modules
branches:
only:
- hexo
env:
global:
- GIT_USER: screw-hand
- GIT_EMAIL: [email protected]
- GH_PAGES_REPO: github.com/screw-hand/screw-hand.github.io.git
before_install:
- openssl aes-256-cbc -K $encrypted_e6cc0fb2b8da_key -iv $encrypted_e6cc0fb2b8da_iv -in travis.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
- export TZ='Asia/Shanghai'
- npm install hexo-cli -g
install:
- yarn
before_script:
- echo -e "Host ${ALI_IP}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
script:
- hexo clean
- hexo g
after_script:
- git config --global user.name ${GIT_USER}
- git config --global user.email ${GIT_EMAIl}
- cd ./public
- git init
- git add .
- git commit -m "Travis CI Auto Builder"
- git push --force --quiet "https://${GIT_USER}:${GH_TOKEN}@${GH_PAGES_REPO}" master:master
- ssh root@${ALI_IP} "cd ~/screw-hand && rm -r ./old-blog/ && mv ./blog/ ./old-blog/ && mkdir blog/"
- scp -r -v ./* root@${ALI_IP}:/root/screw-hand/blog/
- ssh root@${ALI_IP} "cd ~/screw-hand && ./start.sh"
notifications:
email:
recipients:
on_success: change
on_failure: always