-
-
Notifications
You must be signed in to change notification settings - Fork 406
184 lines (153 loc) · 5.22 KB
/
ci.yaml
File metadata and controls
184 lines (153 loc) · 5.22 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: CI pipeline
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
concurrency:
group: "pages"
cancel-in-progress: false
# for security reasons the github actions are pinned to specific SHAs
jobs:
link_checker:
name: Link checker
runs-on: ubuntu-24.04
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Link Checker
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411
with:
args: >-
--verbose
--no-progress
--max-retries 1
--retry-wait-time 10
--max-concurrency 2
'docs/**/*.md'
'docs/*.md'
'*.md'
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
md_linter:
name: Lint web doc
runs-on: ubuntu-24.04
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@07035fd053f7be764496c0f8d8f9f41f98305101
with:
config: '.markdownlint.yaml'
globs: |
docs/**/*.md
docs/*.md
*.md
spell_checker:
name: Check spelling
runs-on: ubuntu-24.04
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Spell check EN language
uses: rojopolis/spellcheck-github-actions@e3cd8e9aec4587ec73bc0e60745aafd45c37aa2e
with:
config_path: .spellcheck-en.yaml
- name: Spell check ES language
uses: rojopolis/spellcheck-github-actions@e3cd8e9aec4587ec73bc0e60745aafd45c37aa2e
with:
config_path: .spellcheck-es.yaml
# rojopolis/spellcheck-github-actions does not support PT-BR,
# only PT, and PT-BR is too different to pass a PT spellcheck
- name: Set up Python for PT-BR
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.10'
- name: Install pyspelling for PT-BR
run: |
python -m pip install --upgrade pip setuptools
python -m pip install pyspelling
sudo apt-get install aspell aspell-pt
- name: Spell check PT-BR language
run: |
python -m pyspelling --config .spellcheck-pt-br.yaml
deploy:
name: Deploy web doc
runs-on: ubuntu-latest
needs: [md_linter, spell_checker]
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Install python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.x
- name: Install python packages
run: |
python -m pip install --upgrade pip setuptools wheel
pip install mkdocs
pip install mkdocs-material
pip install mkdocs-open-in-new-tab
pip install mkdocs-redirects
pip install mkdocs-with-pdf
- name: Copy contributing tab files
run: |
cp code_of_conduct.md docs/.
cp contributing.md docs/.
cp license.txt docs/.
- name: Build check
run: mkdocs build
- name: Deploy
run: mkdocs gh-deploy --force --verbose
export_pdf:
name: Export PDFs
runs-on: ubuntu-latest
needs: [md_linter, spell_checker]
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Install python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.x
- name: Install python packages
run: |
python -m pip install --upgrade pip setuptools wheel
pip install mkdocs
pip install mkdocs-material
pip install mkdocs-open-in-new-tab
pip install mkdocs-redirects
pip install mkdocs-with-pdf
- name: Build check
run: mkdocs build
- name: Create EN PDF
run: mkdocs build --config-file mkdocs-pdf-en.yaml
- name: Upload EN PDF
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: pdf-export-en
path: site/OWASP_Developer_Guide.pdf
- name: Create ES PDF
run: mkdocs build --config-file mkdocs-pdf-es.yaml
- name: Upload ES PDF
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: pdf-export-es
path: site/OWASP_Developer_Guide-ES.pdf
- name: Create FA PDF
run: mkdocs build --config-file mkdocs-pdf-fa.yaml
- name: Upload FA PDF
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: pdf-export-fa
path: site/OWASP_Developer_Guide-FA.pdf
- name: Create PT-BR PDF
run: mkdocs build --config-file mkdocs-pdf-pt-br.yaml
- name: Upload PT-BR PDF
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: pdf-export-pt-br
path: site/OWASP_Developer_Guide-PT-BR.pdf