0%

将Hexo部署到GitLab Pages

开始操作

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
mkdir work
cd work
npm install hexo-cli -g
hexo init
hexo install
hexo s
git clone https://github.com/theme-next/hexo-theme-next themes/next
rm -rf themes/next/.git/
git init
git remote add origin https://gitlab.com/ling218/ling218.gitlab.io.git
git add .
git commit -m "Update"
git push -u origin master
echo "lab.ling218.cn" > source/CNAME
cat <<-EOF >.gitlab-ci.yml
image: node:11.15.0
cache:
paths:
- node_modules/

before_script:
- npm install hexo-cli -g
- npm install

pages:
script:
- hexo generate
artifacts:
paths:
- public
only:
- master
EOF