Skip to content

Restructure network documentation for Ethereum L2 migration #238

Restructure network documentation for Ethereum L2 migration

Restructure network documentation for Ethereum L2 migration #238

Workflow file for this run

name: πŸ“š Documentation Validation
on:
push:
branches: [ main, mintlify ]
pull_request:
branches: [ main, mintlify ]
workflow_dispatch:
jobs:
validate-docs:
name: πŸ” Validate Documentation
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: πŸ“¦ Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml requests
- name: πŸ”§ Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: πŸ“¦ Install Node dependencies
run: |
npm install -g markdownlint-cli2
- name: πŸ—οΈ Validate docs.json structure
run: |
echo "::group::πŸ” Validating docs.json and redirects"
python3 .scripts/validate-redirects.py
echo "::endgroup::"
- name: πŸ”— Check internal links
run: |
echo "::group::πŸ”— Checking internal links"
mkdir -p tmp
python3 .scripts/extract_links.py
python3 .scripts/check_links.py
echo "::endgroup::"
- name: ✨ Lint Markdown files
run: |
echo "::group::✨ Linting Markdown files"
markdownlint-cli2 --config .markdownlint.yaml "**/*.{md,mdx}" || true
echo "::endgroup::"
- name: πŸ“Š Generate validation report
if: always()
run: |
echo "## πŸ“š Documentation Validation Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### βœ… Validation Steps Completed:" >> $GITHUB_STEP_SUMMARY
echo "- docs.json structure and redirects" >> $GITHUB_STEP_SUMMARY
echo "- Internal links verification" >> $GITHUB_STEP_SUMMARY
echo "- Markdown linting" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### πŸ“ˆ Statistics:" >> $GITHUB_STEP_SUMMARY
echo "- **MDX Files**: $(find . -name '*.mdx' | wc -l)" >> $GITHUB_STEP_SUMMARY
echo "- **Navigation Pages**: $(python3 -c 'import json; config=json.load(open("docs.json")); print("N/A - see logs for count")')" >> $GITHUB_STEP_SUMMARY
echo "- **Redirects**: $(python3 -c 'import json; config=json.load(open("docs.json")); print(len(config.get("redirects", [])))')" >> $GITHUB_STEP_SUMMARY
# Optional: Test production redirects (only on main branch)
test-production-redirects:
name: 🌐 Test Production Redirects
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: validate-docs
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: πŸ“¦ Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: πŸ§ͺ Test redirects against production
run: |
echo "::group::🌐 Testing production redirects"
if [ -f .scripts/test-redirects.py ]; then
python3 .scripts/test-redirects.py || true
else
echo "Production redirect test script not found, skipping..."
fi
echo "::endgroup::"