This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.travis.yml
74 lines (67 loc) · 2.88 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
dist: xenial
env:
- MY_DOMAIN=mylabs.dev
branches:
except:
- gh-pages
jobs:
include:
- stage: Tests
name: "Markdown link, lint and spell check"
language: node_js
node_js: 10
install:
# Install markdownlint and markdown-link-check
- npm install -g markdownlint-cli markdown-link-check markdown-spellcheck > /dev/null
script:
# Markdown check
- 'echo "{ MD013: { code_blocks: false } }" > /tmp/markdownlint_config.json'
- find . -name "*.md" -print0 | xargs -0 markdownlint -c /tmp/markdownlint_config.json
# Link Checks
- 'echo "{ \"ignorePatterns\": [ { \"pattern\": \"^(http|https)://localhost\" }, { \"pattern\": \"^(http|https)://.*${MY_DOMAIN}\" } ] }" > /tmp/config.json'
- find . -name "*.md" -print0 | xargs -0 markdown-link-check --config /tmp/config.json --quiet
# Spell Check
- mdspell '**/*.md' --ignore-numbers --ignore-acronyms --report --en-gb
- stage: Tests
name: "Web links check"
language: node_js
services:
- docker
node_js: 10
install:
- npm install vuepress@next @vuepress/plugin-medium-zoom @vuepress/plugin-back-to-top vuepress-plugin-seo
script:
# Get local IP
- export HOST_IP_ADDRESS="$(ip -4 addr show docker0 | sed -n 's/.* inet \([^/]*\).*/\1/p')"
# Build the docs
- vuepress build --silent --dest ${TRAVIS_REPO_SLUG##*/} docs
# Start Web server
- python3 -m http.server 8080 &> /dev/null &
# Check links on generated pages
- docker run -it --rm linkchecker/linkchecker --pause=1 --check-extern --no-status --ignore-url "(http|https)://localhost" --ignore-url "(http|https)://.*${MY_DOMAIN}" http://${HOST_IP_ADDRESS}:8080/${TRAVIS_REPO_SLUG##*/}
- stage: Build & Deploy
name: "Build and Deploy to GitHub pages"
language: node_js
node_js: 10
install:
- npm install vuepress@next @vuepress/plugin-medium-zoom @vuepress/plugin-back-to-top vuepress-plugin-seo
script:
- vuepress build docs
- cp LICENSE docs/.vuepress/dist
- sed -e 's@(part-@(https://github.com/ruzickap/k8s-harbor/tree/master/docs/part-@' -e 's@.\/.vuepress\/public\/@./@' docs/README.md > docs/.vuepress/dist/README.md
deploy:
provider: pages
local-dir: docs/.vuepress/dist
skip-cleanup: true
github-token: $GITHUB_TOKEN
target-branch: gh-pages
on:
branch: master
- stage: Web Links Check
name: "Final web links check with deployed web pages"
language: minimal
services:
- docker
script:
- docker run -it --rm linkchecker/linkchecker --pause=1 --check-extern --no-status --ignore-url "(http|https)://localhost" --ignore-url "(http|https)://.*${MY_DOMAIN}" https://${TRAVIS_REPO_SLUG%/*}.github.io/${TRAVIS_REPO_SLUG##*/}