Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ddb44e9846 | |||
| f1f4a69bd1 | |||
| dea9106556 | |||
| f7345b5433 | |||
| a5640d0e02 | |||
| 50252ece04 | |||
| 0fa737e74b | |||
| 973dbefabb | |||
| afd82d071c | |||
| ead328c075 | |||
| 155c9a4222 | |||
| bdbce0664b | |||
| c185079bf1 | |||
| 039228ab99 | |||
| 58d7f6be48 | |||
| 4dd5e308cf |
33
.github/workflows/ci-docs.yml
vendored
33
.github/workflows/ci-docs.yml
vendored
@@ -1,19 +1,26 @@
|
|||||||
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
|
||||||
@@ -27,9 +34,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
npx --yes cspell \
|
npx --yes cspell \
|
||||||
--config tools/spellcheck/cspell.yml \
|
--config ${CSPELL_CONFIG} \
|
||||||
"docs/**/*.md" \
|
${CSPELL_TARGETS}
|
||||||
README.md
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -37,8 +43,15 @@ 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
|
||||||
# Default not strict on if unset
|
echo "Strict is set to ${MKDOCS_STRICT}"
|
||||||
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
FLAGS=()
|
||||||
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}"
|
||||||
54
.github/workflows/deploy-rc-pages.yml
vendored
54
.github/workflows/deploy-rc-pages.yml
vendored
@@ -2,7 +2,7 @@ name: Deploy RC preview to GitHub Pages
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["rc*"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -13,30 +13,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Guard - only run for RC tags; deploy only on GitHub
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
TAG="${GITHUB_REF_NAME:-}"
|
|
||||||
CI_PROVIDER="${CI_PROVIDER:-github}"
|
|
||||||
ENABLE_DEPLOY="${ENABLE_DEPLOY:-false}"
|
|
||||||
|
|
||||||
if [[ -z "$TAG" ]] || [[ "$TAG" != v* ]] || [[ "$TAG" != *"-rc"* ]]; then
|
|
||||||
echo "Not an RC tag ($TAG); skipping."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if [[ "${ENABLE_DEPLOY}" != "true" ]]; then
|
|
||||||
echo "Skipping deploy: ENABLE_DEPLOY=${ENABLE_DEPLOY}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if [[ "${ACT:-false}" == "true" ]]; then
|
|
||||||
echo "Skipping deploy: act"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if [[ "${CI_PROVIDER}" != "github" ]]; then
|
|
||||||
echo "Skipping deploy: CI_PROVIDER=${CI_PROVIDER}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Checkout (tag)
|
- name: Checkout (tag)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -76,27 +52,25 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish RC preview under /rc/<tag>/
|
- name: Publish RC preview under /rc/<tag>/
|
||||||
run: |
|
run: |
|
||||||
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
|
||||||
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
||||||
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
REF="${GITHUB_REF_NAME}"
|
rm -rf "rc"* || true
|
||||||
mkdir -p "rc/${REF}"
|
mkdir -p "rc/"
|
||||||
rm -rf "rc/${REF:?}/"* || true
|
cp -a "$OUTPUT_DIR/." "rc/"
|
||||||
cp -a "$OUTPUT_DIR" "rc/${REF}/"
|
|
||||||
|
|
||||||
mkdir -p rc
|
|
||||||
if [ ! -f rc/index.html ]; then
|
|
||||||
cat > rc/index.html << 'EOF'
|
|
||||||
<!doctype html><meta charset="utf-8"><title>RC Previews</title>
|
|
||||||
<h1>Release Candidate Preview</h1>
|
|
||||||
<p><a href="rc/${REF:?}/">${REF:?}</p>
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
git add -A
|
git add -A
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git commit -m "Deploy RC preview ${REF}" || echo "No changes to commit"
|
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
git push origin gh-pages
|
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 }}
|
||||||
97
.github/workflows/release.yml
vendored
Normal file
97
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
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:-true}" mkdocs build \
|
||||||
|
"${FLAGS[@]}" \
|
||||||
|
-f "${MKDOCS_CONFIG}" \
|
||||||
|
-d "${MKDOCS_OUTPUT_DIR}/offline"
|
||||||
|
mkdocs build \
|
||||||
|
"${FLAGS[@]}" \
|
||||||
|
-f "${MKDOCS_CONFIG}" \
|
||||||
|
-d "${MKDOCS_OUTPUT_DIR}/dist"
|
||||||
|
|
||||||
|
- name: Zip site
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
cd "${MKDOCS_OUTPUT_DIR}"
|
||||||
|
zip -r "${GITHUB_REF_NAME}.zip" "./offline"
|
||||||
|
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 :)"
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
title: Chicago Metropolitan Baseball Association
|
|
||||||
subtitle: Constitution and By-Laws
|
|
||||||
date: 2024-06-06
|
|
||||||
---
|
|
||||||
@@ -37,3 +37,7 @@ 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