jrnl/.github/workflows/docs.yaml
Jonathan Wren e7f24527c3
Fix styling on documentation sidebar (#1395)
* fix sidebar stling in docs theme

* don't display heading levels higher than 3 in sidebar

* update sitemap step for easier debugging

* add matrix so github doesn't get confused
2022-01-08 14:51:02 -08:00

81 lines
1.9 KiB
YAML

name: Docs
on:
push:
branches: [ develop, release ]
paths:
- 'docs/**'
- 'docs_theme/**'
- 'mkdocs.yml'
- 'readthedocs.yml'
- '.github/workflows/docs.yaml'
pull_request:
branches: [ develop ]
paths:
- 'docs/**'
- 'docs_theme/**'
- 'mkdocs.yml'
- 'readthedocs.yml'
- '.github/workflows/docs.yaml'
jobs:
accessibility:
if: contains(toJson(github.event.commits), '[ci skip]') == false
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [ 3.9 ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Node.js environment
uses: actions/setup-node@main
- name: poetry cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }}
- name: npm cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-pa11y-v3
- name: Install dependencies
run: |
pip install poetry
poetry config --local virtualenvs.in-project true
poetry install --no-root --remove-untracked
npm install pa11y-ci
echo "node_modules/.bin" >> $GITHUB_PATH
- name: Start docs server
run: poetry run mkdocs serve &
- name: Generate sitemap
env:
site_url: http://127.0.0.1:8000
run: |
filename='sitemap.xml'
select="{urls: [\"${site_url}/\", \"${site_url}/search.html?q=jrnl\", .urlset.url[].loc]}"
curl -s "${site_url}/${filename}" > $filename
echo "::group::${filename}"
cat $filename
echo '::endgroup::'
poetry run xq "$select" $filename > list.json
- name: Accessibility testing (Pa11y)
run: pa11y-ci -c list.json