-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
87 lines (73 loc) · 2.27 KB
/
.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
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
variables:
GIT_STRATEGY: none
DOCKER_IMAGE: webpage:$CI_PIPELINE_ID
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
stages:
- build
- test
- release
- cleanup
Build Linter:
stage: build
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
script: docker build -t "${DOCKER_IMAGE}" .
Test mkdocs:
stage: test
script: docker run ${DOCKER_IMAGE}
Check wording of changed md-files:
stage: test
script:
- docker run --rm -w /src -e CI_MERGE_REQUEST_TARGET_BRANCH_NAME "${DOCKER_IMAGE}"
doc.zih.tu-dresden.de/util/grep-forbidden-words.sh
only: [ merge_requests ]
Lint changed md-files:
stage: test
script:
- docker run --rm -w /src -e CI_MERGE_REQUEST_TARGET_BRANCH_NAME "${DOCKER_IMAGE}"
doc.zih.tu-dresden.de/util/lint-changes.sh
only: [ merge_requests ]
Check spelling for changed md-files:
stage: test
script:
- docker run --rm -w /src -e CI_MERGE_REQUEST_TARGET_BRANCH_NAME "${DOCKER_IMAGE}"
doc.zih.tu-dresden.de/util/check-spelling.sh
only: [ merge_requests ]
Check links for changed md-files:
stage: test
script:
- docker run --rm -w /src -e CI_MERGE_REQUEST_TARGET_BRANCH_NAME "${DOCKER_IMAGE}"
doc.zih.tu-dresden.de/util/check-links.sh
only: [ merge_requests ]
Lint md-files:
stage: test
script: docker run --rm "${DOCKER_IMAGE}" markdownlint docs
only: [ main, preview ]
Check links for md-files:
stage: test
script:
- docker run --rm "${DOCKER_IMAGE}"
bash -c "find docs -type f -name '*.md' | xargs -L1 markdown-link-check --quiet"
only: [ main, preview ]
Release preview branch:
stage: release
script:
- docker run --rm -v /var/www/html/preview:/mnt "${DOCKER_IMAGE}" mkdocs build --strict --site-dir /mnt
only: [ preview ]
Release:
stage: release
script:
- docker run --rm -v /var/www/html/hpc-wiki:/mnt "${DOCKER_IMAGE}" mkdocs build --strict --site-dir /mnt
only: [ main ]
Cleanup docker:
stage: cleanup
script:
- docker rmi -f "${DOCKER_IMAGE}"
- docker system prune --force
when: always