mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
GitHub Actions for doc (#12353)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
50
.github/workflows/doc.yml
vendored
Normal file
50
.github/workflows/doc.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: doc
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '.github/workflows/doc.yml'
|
||||
- 'doc/**'
|
||||
- 'mkdocs.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '.github/workflows/doc.yml'
|
||||
- 'doc/**'
|
||||
- 'mkdocs.yml'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Build mkdocs Docker image
|
||||
run: |
|
||||
docker build -t mkdocs -f ./doc/Dockerfile ./
|
||||
-
|
||||
name: Build docs
|
||||
run: |
|
||||
docker run --rm -v "$(pwd):/docs" mkdocs build --strict
|
||||
sudo chown -R $(id -u):$(id -g) ./out
|
||||
-
|
||||
name: Check GitHub Pages status
|
||||
uses: crazy-max/ghaction-github-status@v2
|
||||
with:
|
||||
pages_threshold: major_outage
|
||||
-
|
||||
name: Deploy
|
||||
if: github.event_name != 'pull_request' && endsWith(github.ref, github.event.repository.default_branch)
|
||||
uses: crazy-max/ghaction-github-pages@v2
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: out
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
16
doc/Dockerfile
Normal file
16
doc/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM squidfunk/mkdocs-material:6.1.0
|
||||
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
git \
|
||||
git-fast-import \
|
||||
openssh \
|
||||
&& apk add --no-cache --virtual .build gcc musl-dev \
|
||||
&& pip install --no-cache-dir \
|
||||
'markdown-include' \
|
||||
'mkdocs-awesome-pages-plugin' \
|
||||
'mkdocs-exclude' \
|
||||
'mkdocs-git-revision-date-localized-plugin' \
|
||||
'mkdocs-macros-plugin' \
|
||||
&& apk del .build gcc musl-dev \
|
||||
&& rm -rf /tmp/*
|
@@ -29,7 +29,9 @@ plugins:
|
||||
j2_variable_end_string: '=@'
|
||||
- search
|
||||
- exclude:
|
||||
glob: General/Changelogs/*
|
||||
glob:
|
||||
- "General/Changelogs/*"
|
||||
- "Dockerfile"
|
||||
extra_css:
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
|
||||
- librenms.css
|
||||
|
Reference in New Issue
Block a user