Skip to content

Commit

Permalink
GitHub Actions for doc (librenms#12353)
Browse files Browse the repository at this point in the history
Co-authored-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max and crazy-max authored Nov 25, 2020
1 parent 927fac6 commit d8c617d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions doc/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8c617d

Please sign in to comment.