-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
34 lines (32 loc) · 1015 Bytes
/
.gitlab-ci.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
stages:
# - getSubmodule
- deploy
# variables:
# GIT_SUBMODULE_STRATEGY: recursive
pages:
image: node:latest
stage: deploy
# 由于 gitlab 未提供拉取私有仓库 submodule 的配置,所以只能自行配置
# https://stackoverflow.com/questions/25689231/getting-gitlab-ci-to-clone-private-repositories
before_script:
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- git submodule update --init
- ls ./notes
script:
# 国内install gatsby 会因为无法下载libvipse失败
# 所以只能本地移动到 node_modules
- mkdir node_modules
# - cp -r ./gatsby ./node_modules/
- cp -r ./sharp ./node_modules/
- npm install -f
- npm run build
# - ./node_modules/.bin/gatsby build --prefix-paths
artifacts:
paths:
- public
only:
- main