Compare commits
2 Commits
351af45301
...
rc2026.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 58d7f6be48 | |||
| 4dd5e308cf |
33
.github/workflows/ci-docs.yml
vendored
33
.github/workflows/ci-docs.yml
vendored
@@ -1,26 +1,19 @@
|
|||||||
name: CI - Docs build check
|
name: CI - Docs build check
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches-ignore:
|
||||||
|
- gh-pages
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- develop
|
|
||||||
- release-candidate
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
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:
|
jobs:
|
||||||
build-check:
|
build-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -34,8 +27,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
npx --yes cspell \
|
npx --yes cspell \
|
||||||
--config ${CSPELL_CONFIG} \
|
--config tools/spellcheck/cspell.yml \
|
||||||
${CSPELL_TARGETS}
|
"docs/**/*.md" \
|
||||||
|
README.md
|
||||||
|
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -43,15 +37,8 @@ jobs:
|
|||||||
pip install -r mkdocs/requirements.txt
|
pip install -r mkdocs/requirements.txt
|
||||||
|
|
||||||
- name: MkDocs build (strict default)
|
- name: MkDocs build (strict default)
|
||||||
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
echo "Strict is set to ${MKDOCS_STRICT}"
|
# Default not strict on if unset
|
||||||
FLAGS=()
|
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
||||||
|
tools/build.sh --config mkdocs/mkdocs.yml
|
||||||
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}"
|
|
||||||
76
.github/workflows/deploy-rc-pages.yml
vendored
Normal file
76
.github/workflows/deploy-rc-pages.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
name: Deploy RC preview to GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["rc*"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-rc-pages:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout (tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
pip install -r mkdocs/requirements.txt
|
||||||
|
|
||||||
|
- name: Build site (strict default)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
||||||
|
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
||||||
|
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
||||||
|
tools/build.sh --config mkdocs/mkdocs.yml
|
||||||
|
|
||||||
|
- name: Checkout gh-pages branch
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
git fetch origin gh-pages:gh-pages || true
|
||||||
|
if git show-ref --verify --quiet refs/heads/gh-pages; then
|
||||||
|
git switch gh-pages
|
||||||
|
else
|
||||||
|
git switch --orphan gh-pages
|
||||||
|
rm -rf ./*
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit --allow-empty -m "Initialize gh-pages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Publish RC preview under /rc/<tag>/
|
||||||
|
run: |
|
||||||
|
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
||||||
|
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
rm -rf "rc"* || true
|
||||||
|
mkdir -p "rc/"
|
||||||
|
cp -a "$OUTPUT_DIR/." "rc/"
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
|
git push origin gh-pages
|
||||||
|
- name: Publish prerelease (GitHub)
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
prerelease: true
|
||||||
|
body: |
|
||||||
|
RC preview: https://<org>.github.io/<repo>/rc/
|
||||||
|
|
||||||
|
Tag: ${{ github.ref_name }}
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
114
.github/workflows/release.yml
vendored
114
.github/workflows/release.yml
vendored
@@ -1,114 +0,0 @@
|
|||||||
name: Build & publish docs (rc + release)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "rc*"
|
|
||||||
- "v*"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
MKDOCS_CONFIG: mkdocs/mkdocs.yml
|
|
||||||
MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT || 'true' }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout (tag)
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
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 (normal + offline, strict gate)
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
FLAGS=()
|
|
||||||
if [ "${MKDOCS_STRICT}" = "true" ]; then
|
|
||||||
FLAGS+=(--strict)
|
|
||||||
fi
|
|
||||||
|
|
||||||
OUT_BASE="${RUNNER_TEMP}/mkdocs_out"
|
|
||||||
SITE="${OUT_BASE}/site"
|
|
||||||
SITE_OFFLINE="${OUT_BASE}/site_offline"
|
|
||||||
|
|
||||||
rm -rf "${OUT_BASE}"
|
|
||||||
mkdir -p "${SITE}" "${SITE_OFFLINE}"
|
|
||||||
|
|
||||||
mkdocs build "${FLAGS[@]}" -f "${MKDOCS_CONFIG}" -d "${SITE}"
|
|
||||||
OFFLINE=true mkdocs build "${FLAGS[@]}" -f "${MKDOCS_CONFIG}" -d "${SITE_OFFLINE}"
|
|
||||||
|
|
||||||
- name: Zip offline site
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
cd "${RUNNER_TEMP}/mkdocs_out"
|
|
||||||
zip -r "${GITHUB_REF_NAME}.zip" site_offline
|
|
||||||
|
|
||||||
- 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 }}/mkdocs_out/${{ github.ref_name }}.zip
|
|
||||||
|
|
||||||
- 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 }}/mkdocs_out/${{ github.ref_name }}.zip
|
|
||||||
|
|
||||||
- name: Checkout gh-pages branch
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: gh-pages
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Deploy release to gh-pages root
|
|
||||||
if: startsWith(github.ref_name, 'v')
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
rm -rf ./*
|
|
||||||
cp -a ${RUNNER_TEMP}/mkdocs_out/site/. .
|
|
||||||
git add -A
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git commit -m "Deploy release ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
|
||||||
git push origin gh-pages
|
|
||||||
|
|
||||||
- name: Deploy RC preview to /rc/
|
|
||||||
if: startsWith(github.ref_name, 'rc')
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
rm -rf rc
|
|
||||||
mkdir -p rc
|
|
||||||
cp -a ${RUNNER_TEMP}/mkdocs_out/site/. rc/
|
|
||||||
printf '{"tag":"%s"}\n' "${GITHUB_REF_NAME}" > rc/rc.json
|
|
||||||
|
|
||||||
git add -A
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
|
||||||
git push origin gh-pages
|
|
||||||
5
metadata.yml
Normal file
5
metadata.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: Chicago Metropolitan Baseball Association
|
||||||
|
subtitle: Constitution and By-Laws
|
||||||
|
date: 2024-06-06
|
||||||
|
---
|
||||||
@@ -37,7 +37,3 @@ plugins:
|
|||||||
toc_depth: 2
|
toc_depth: 2
|
||||||
exclude:
|
exclude:
|
||||||
- index.md
|
- 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
|
if [ "${MKDOCS_STRICT}" = "true" ]; then
|
||||||
STRICT_FLAG="--strict"
|
STRICT_FLAG="--strict"
|
||||||
fi
|
fi
|
||||||
echo "MKDOCS_STRICT: $MKDOCS_STRICT, STRICT_FLAG: $STRICT_FLAG"
|
|
||||||
mkdocs build ${STRICT_FLAG} -f $MKDOCS_CONFIG -d $OUTPUT_DIR
|
mkdocs build ${STRICT_FLAG} -f $MKDOCS_CONFIG -d $OUTPUT_DIR
|
||||||
Reference in New Issue
Block a user