Merge pull request #2535 from sebix/fix-perms-tests-exc #2496
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ruamel.yaml | |
- name: "Generate Feed and Event documentation" | |
run: | | |
python3 scripts/generate-feeds-docs.py | |
python3 scripts/generate-event-docs.py | |
- 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 }} |