-
Notifications
You must be signed in to change notification settings - Fork 513
137 lines (111 loc) · 3.71 KB
/
main.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BUILD_VIDEOS: true
NOKOGIRI_USE_SYSTEM_LIBRARIES: true # for faster htmlproofer install
jobs:
vale-runner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Vale Linter
uses: errata-ai/vale-action@reviewdog
env:
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: docs/
vale_flags: "--config=vale/vale.ini"
reporter: github-pr-check
fail_on_error: true
filter_mode: file
- name: Vale Guide Linter
uses: errata-ai/vale-action@reviewdog
env:
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: docs/guide/
vale_flags: "--config=vale/guide.ini"
reporter: github-pr-check
fail_on_error: true
filter_mode: file
yaml-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U yamale ruamel.yaml
- name: Validate YAML
run: docs/_scripts/validate-yaml.sh
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/codespell-problem-matcher@v1
- uses: codespell-project/actions-codespell@v1
name: Check spelling
with:
skip: "*.pdf,*.svg,*.js,*.map,*.css,*.scss,docs/_data/201[5|6|7]*,docs/_static_html/*"
ignore_words_file: "codespell/ignore.txt"
path: docs
sphinx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache python env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: v2-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Build docs
uses: rickstaa/sphinx-action@master
with:
docs-folder: "./docs"
build-command: "sphinx-build -q -W -b dirhtml -d _build/doctrees . _build/html"
# Upload performance is awful on the many small files our build generates,
# so it's compressed locally before uploading
- name: Compress site
run: tar -czf html.tar.gz docs/_build/html
- name: Archive site HTML
uses: actions/upload-artifact@v2
with:
name: html
path: html.tar.gz
links-internal:
runs-on: ubuntu-latest
needs: sphinx
steps:
- name: Download site HTML
uses: actions/download-artifact@v2
with:
name: html
- name: Uncompress site
run: tar -xzf html.tar.gz
- name: Install html-proofer
run: sudo gem install html-proofer -v '<4.4'
- name: Check links
run: |
htmlproofer --ignore-files "/404/,/2013/,/2014/,/2015/,/2016/,/2017/,/search\/index.html/" --allow-hash-href=true --enforce-https=false --ignore-missing-alt=true --disable-external=true docs/_build/html