diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 816a54c..ae7c94e 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -10,6 +10,12 @@ on: permissions: contents: read +env: + MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT:-true }} + MKDOCS_CONFIG: mkdocs/mkdocs.yml + CSPELL_CONFIG: tools/spellcheck/cspell.yml + CSPELL_TARGETS: "docs/**/*.md" README.md + jobs: build-check: runs-on: ubuntu-latest @@ -27,9 +33,8 @@ jobs: run: | set -euo pipefail npx --yes cspell \ - --config tools/spellcheck/cspell.yml \ - "docs/**/*.md" \ - README.md + --config ${CSPELL_CONFIG \ + ${CSPELL_TARGETS} - name: Install build dependencies run: | @@ -37,10 +42,15 @@ jobs: pip install -r mkdocs/requirements.txt - name: MkDocs build (strict default) - env: - MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT }} + run: | set -euo pipefail - # Default strict on if unset echo "Strict is set to ${MKDOCS_STRICT}" - tools/build.sh \ No newline at end of file + FLAGS=() + + if [ "${MKDOCS_STRICT}" = "true" ]; then + FLAGS+=(--strict) + fi + MKDOCS_OUTPUT_DIR="${RUNNER_TEMP:-${TMPDIR:-/tmp}}/dist" + + mkdocs build "${FLAGS[@]}" -f "${MKDOCS_CONFIG}" -d "${MKDOCS_OUTPUT_DIR}" \ No newline at end of file