test with local action
All checks were successful
mkdocs build / build (push) Successful in 39s

This commit is contained in:
Ludovic Cartier 2024-08-29 12:03:10 +02:00
parent 912f9fcaa2
commit f264905572
4 changed files with 51 additions and 3 deletions

View File

@ -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

View 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"]

View 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'

View 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"