Skip to content

feat: continue full updates with github pages docs and markdown worker #1

feat: continue full updates with github pages docs and markdown worker

feat: continue full updates with github pages docs and markdown worker #1

name: Docs GitHub Pages Publish
on:
push:
branches:
- main
- master
paths:
- "docs/**"
- "mkdocs.yml"
- "docs/requirements-mkdocs.txt"
- "scripts/run-mkdocs.js"
- "package.json"
- "package-lock.json"
- "README.md"
- ".github/workflows/docs-github-pages-publish.yml"
workflow_dispatch:
inputs:
git_ref:
description: "Branch, tag, or commit to publish from (rollback)"
required: false
type: string
site_url:
description: "MkDocs site_url override"
required: false
default: "https://jacobinwwey.github.io/NoteConnection/"
type: string
base_path:
description: "MkDocs base path override"
required: false
default: "/NoteConnection/"
type: string
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: docs-github-pages
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
verify-diataxis-map:
name: verify-diataxis-map
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.git_ref != '' && github.event.inputs.git_ref || github.ref }}
lfs: false
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Verify Diataxis mapping governance
run: npm run docs:diataxis:check
build-site:
name: build-site
runs-on: ubuntu-latest
needs: verify-diataxis-map
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.git_ref != '' && github.event.inputs.git_ref || github.ref }}
lfs: false
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: docs/requirements-mkdocs.txt
- name: Install MkDocs dependencies
run: pip install -r docs/requirements-mkdocs.txt
- name: Resolve MkDocs runtime URL config
shell: bash
run: |
SITE_URL="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.site_url || '' }}"
BASE_PATH="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.base_path || '' }}"
if [ -z "${SITE_URL}" ]; then
SITE_URL="https://jacobinwwey.github.io/NoteConnection/"
fi
if [ -z "${BASE_PATH}" ]; then
BASE_PATH="/NoteConnection/"
fi
echo "MKDOCS_SITE_URL=${SITE_URL}" >> "$GITHUB_ENV"
echo "MKDOCS_BASE_PATH=${BASE_PATH}" >> "$GITHUB_ENV"
echo "MKDOCS_DOCS_HOST=https://jacobinwwey.github.io/" >> "$GITHUB_ENV"
echo "site_url=${SITE_URL}" >> "$GITHUB_OUTPUT"
echo "base_path=${BASE_PATH}" >> "$GITHUB_OUTPUT"
- name: Build docs site
run: mkdocs build --config-file mkdocs.yml
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: build/mkdocs-site
deploy-site:
name: deploy-site
runs-on: ubuntu-latest
needs: build-site
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4