forked from SJTU-HPC/docs.hpc.sjtu.edu.cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml.bak
95 lines (87 loc) · 1.97 KB
/
.gitlab-ci.yml.bak
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
image: python:3.7
stages:
- build
- test
- deploy
- post-deploy
markdown_lint:
allow_failure: true
image: node
stage: test
except:
- schedules
- master@NERSC/nersc.gitlab.io
script:
- npm install -g markdownlint-cli
- bash util/lint-changes.sh
filesize:
allow_failure: true
image: ubuntu:latest
stage: test
except:
- schedules
- master@NERSC/nersc.gitlab.io
before_script:
- apt-get update && apt-get install -y git
script:
- bash util/filesize.sh
mkdocs_build:
stage: build
except:
- schedules
script:
- mkdir -p .build_cache
- pip install --upgrade --cache-dir=.build_cache -r requirements.txt
- mkdocs --verbose build
artifacts:
paths:
- public
expire_in: 1 week
cache:
key: ${CI_JOB_NAME}
paths:
- .build_cache
check_internal_links:
stage: build
script:
- bash util/check-internal-links.sh
check_links:
allow_failure: true
stage: test
only:
- schedules
script:
- mkdir -p .links_cache
- pip install --cache-dir=.links_cache -r util/requirements.txt
- python util/scrape_urls.py public
pages:
stage: deploy
except:
- schedules
only:
- master@NERSC/nersc.gitlab.io
before_script:
- pip install htmlmin
script:
- gzip -k -6 -r public/assets/stylesheets
- gzip -k -6 -r public/assets/javascripts
- find public -type f -name "*.html" -exec gzip --keep --verbose {} \;
- mkdir -p public/.well-known/pki-validation/
- echo 1ulpvnf7n6o5idmfdlk4aa2e87 > public/.well-known/pki-validation/godaddy.html
artifacts:
paths:
- public
update-search-api:
image: ubuntu:18.04
stage: post-deploy
only:
- master@NERSC/nersc.gitlab.io
except:
- schedules
before_script:
- apt-get update; apt-get -y install curl
script:
- "curl --request POST \
--url https://nersc-docs-search-app-214117.appspot.com/reindex \
--header 'content-type: application/json' \
--data '{\"source\":\"docs\"}'"