Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7345b5433 | |||
| a5640d0e02 | |||
| 50252ece04 | |||
| 0fa737e74b | |||
| 973dbefabb | |||
| afd82d071c | |||
| ead328c075 | |||
| 155c9a4222 | |||
| bdbce0664b | |||
| c185079bf1 |
33
.github/workflows/ci-docs.yml
vendored
33
.github/workflows/ci-docs.yml
vendored
@@ -1,19 +1,26 @@
|
||||
name: CI - Docs build check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- gh-pages
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- release-candidate
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT || 'true' }}
|
||||
MKDOCS_CONFIG: mkdocs/mkdocs.yml
|
||||
MKDOCS_OFFLINE: false
|
||||
CSPELL_CONFIG: tools/spellcheck/cspell.yml
|
||||
CSPELL_TARGETS: docs/**/*.md README.md
|
||||
|
||||
jobs:
|
||||
build-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -27,9 +34,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,8 +43,15 @@ jobs:
|
||||
pip install -r mkdocs/requirements.txt
|
||||
|
||||
- name: MkDocs build (strict default)
|
||||
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Default strict on if unset
|
||||
echo "Strict is set to {MKDOCS_STRICT:-true}"
|
||||
tools/build.sh
|
||||
echo "Strict is set to ${MKDOCS_STRICT}"
|
||||
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}"
|
||||
93
.github/workflows/release.yml
vendored
Normal file
93
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
name: Build & publish docs (rc + release)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "rc-*"
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
MKDOCS_CONFIG: mkdocs/mkdocs.yml
|
||||
MKDOCS_OUTPUT_DIR: ${{ runner.temp }}/dist
|
||||
MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT || 'true' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
set -euo pipefail
|
||||
pip install -r mkdocs/requirements.txt
|
||||
|
||||
- name: Build docs (strict gate)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
FLAGS=()
|
||||
if [ "${MKDOCS_STRICT}" = "true" ]; then
|
||||
FLAGS+=(--strict)
|
||||
fi
|
||||
|
||||
mkdir -p "${MKDOCS_OUTPUT_DIR}"
|
||||
|
||||
OFFLINE="${OFFLINE}" mkdocs build \
|
||||
"${FLAGS[@]}" \
|
||||
-f "${MKDOCS_CONFIG}" \
|
||||
-d "${MKDOCS_OUTPUT_DIR}"
|
||||
|
||||
- name: Zip site
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "${MKDOCS_OUTPUT_DIR}"
|
||||
zip -r "${GITHUB_REF_NAME}.zip" .
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
# -------------------------
|
||||
# RC-only step
|
||||
# -------------------------
|
||||
- name: Publish prerelease
|
||||
if: startsWith(github.ref_name, 'rc-')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
prerelease: true
|
||||
name: ${{ github.ref_name }}
|
||||
tag_name: ${{ github.ref_name }}
|
||||
body: |
|
||||
Release candidate preview (if deployed): /rc/
|
||||
files: |
|
||||
${{ runner.temp }}/${{ github.ref_name }}.zip
|
||||
|
||||
# -------------------------
|
||||
# Final release-only step
|
||||
# -------------------------
|
||||
- name: Publish release
|
||||
if: startsWith(github.ref_name, 'v')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: ${{ github.ref_name }}
|
||||
tag_name: ${{ github.ref_name }}
|
||||
files: |
|
||||
${{ runner.temp }}/${{ github.ref_name }}.zip
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy
|
||||
run: |
|
||||
echo "TBD :)"
|
||||
|
||||
@@ -37,3 +37,7 @@ plugins:
|
||||
toc_depth: 2
|
||||
exclude:
|
||||
- index.md
|
||||
|
||||
validation:
|
||||
links:
|
||||
anchors: warn #this defaults to info, but it will cause broken links in anchor headers
|
||||
@@ -11,5 +11,5 @@ STRICT_FLAG=""
|
||||
if [ "${MKDOCS_STRICT}" = "true" ]; then
|
||||
STRICT_FLAG="--strict"
|
||||
fi
|
||||
|
||||
echo "MKDOCS_STRICT: $MKDOCS_STRICT, STRICT_FLAG: $STRICT_FLAG"
|
||||
mkdocs build ${STRICT_FLAG} -f $MKDOCS_CONFIG -d $OUTPUT_DIR
|
||||
Reference in New Issue
Block a user