-
Notifications
You must be signed in to change notification settings - Fork 296
65 lines (52 loc) · 1.55 KB
/
build-docs.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
# SPDX-FileCopyrightText: 2023 Filip Pokorný
# SPDX-License-Identifier: AGPL-3.0-or-later
name: "Build and publish documentation"
on:
push:
branches:
- develop
- maintenance
- mkdocs
pull_request:
branches:
- develop
- maintenance
- mkdocs
release:
types:
- published
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup python"
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: "Install build dependencies"
run: |
pip install mkdocs-material mike lunr pygments mkdocstrings[python] mkdocs-material mkdocs-glightbox mkdocs-redirects mkdocs-minify-plugin
- name: "Prepare git"
run: |
git fetch origin gh-pages --depth=1
git config user.name intelmq-bot
git config user.email intelmq-bot
- name: "Fix images path"
run: |
sed -i 's|docs/static/images/|static/images/|' docs/index.md
- name: "Build docs without publishing"
if: github.event_name == 'pull_request'
run: |
mkdocs build
- name: "Build docs with version tag and publish"
if: github.event_name == 'release'
run: |
mike deploy --push --update-aliases ${{ github.ref_name }} latest
- name: "Build docs with branch tag and publish"
if: github.event_name == 'push'
run: |
mike deploy --push ${{ github.ref_name }}