This commit is contained in:
parent
912f9fcaa2
commit
f264905572
@ -11,6 +11,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build with MkDocs
|
# - name: Build with MkDocs
|
||||||
uses: moonpathbg/mkdocs_builder@latest # https://github.com/moonpathbg/mkdocs_builder
|
# uses: moonpathbg/mkdocs_builder@latest # https://github.com/moonpathbg/mkdocs_builder
|
||||||
#uses: romw314/mkdocs-action@v2 # https://github.com/marketplace/actions/mkdocs-build
|
# #uses: romw314/mkdocs-action@v2 # https://github.com/marketplace/actions/mkdocs-build
|
||||||
|
- name: Mkdocs build
|
||||||
|
uses: ./mkdocs-build-action/ # Uses an action in the root directory
|
||||||
|
id: build
|
||||||
|
9
mkdocs-build-action/Dockerfile
Normal file
9
mkdocs-build-action/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM python:latest
|
||||||
|
|
||||||
|
RUN python3 -m pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-swan mkdocs-helm mkdocs-licenseinfo mkdocs-multilang mkdocs-autozip
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
25
mkdocs-build-action/action.yml
Normal file
25
mkdocs-build-action/action.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: 'MkDocs Build'
|
||||||
|
description: 'Build your MkDocs projects'
|
||||||
|
inputs:
|
||||||
|
config-file:
|
||||||
|
description: 'The path to the MkDocs configuration file'
|
||||||
|
required: false
|
||||||
|
default: 'mkdocs.yml'
|
||||||
|
output-dir:
|
||||||
|
description: 'The directory to output the HTML site to, relative to workdir (see below)'
|
||||||
|
required: false
|
||||||
|
default: '_site'
|
||||||
|
workdir:
|
||||||
|
description: 'The root directory of your project (which contains the `docs` dir)'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- ${{ inputs.config-file }}
|
||||||
|
- ${{ inputs.output-dir }}
|
||||||
|
- ${{ inputs.workdir }}
|
||||||
|
branding:
|
||||||
|
icon: 'book'
|
||||||
|
color: 'blue'
|
11
mkdocs-build-action/entrypoint.sh
Normal file
11
mkdocs-build-action/entrypoint.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
cd "$3"
|
||||||
|
|
||||||
|
if test -d .git; then
|
||||||
|
git config --global --add safe.directory "$(realpath "$3")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdocs build --config-file "$1" --site-dir "$2"
|
Loading…
x
Reference in New Issue
Block a user