forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Actions for doc (librenms#12353)
Co-authored-by: CrazyMax <[email protected]>
- Loading branch information
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
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
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 }} |
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
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/* |
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