2021-02-25 12:35:46 +01:00
|
|
|
name: Docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'docs/**'
|
2022-03-07 10:56:31 +01:00
|
|
|
- '.github/workflows/docs.yml'
|
2021-02-25 12:35:46 +01:00
|
|
|
push:
|
|
|
|
branches:
|
2021-03-09 07:27:51 +01:00
|
|
|
- main
|
2021-02-25 12:35:46 +01:00
|
|
|
paths:
|
|
|
|
- 'docs/**'
|
2022-03-07 10:56:31 +01:00
|
|
|
- '.github/workflows/docs.yml'
|
2021-02-25 12:35:46 +01:00
|
|
|
|
2022-03-07 13:17:58 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-08-04 20:00:35 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-02-25 12:35:46 +01:00
|
|
|
jobs:
|
|
|
|
docs:
|
2021-07-29 11:54:14 +02:00
|
|
|
# OS must be the same as on djangoproject.com.
|
2022-03-08 09:29:32 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-25 12:35:46 +01:00
|
|
|
name: docs
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-07 10:56:31 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-02-25 12:35:46 +01:00
|
|
|
- name: Set up Python
|
2022-06-24 07:38:13 +02:00
|
|
|
uses: actions/setup-python@v4
|
2021-02-25 12:35:46 +01:00
|
|
|
with:
|
2022-10-25 05:34:09 +02:00
|
|
|
python-version: '3.11'
|
2022-03-07 10:56:31 +01:00
|
|
|
cache: 'pip'
|
|
|
|
cache-dependency-path: 'docs/requirements.txt'
|
2021-02-25 12:35:46 +01:00
|
|
|
- run: python -m pip install -r docs/requirements.txt
|
|
|
|
- name: Build docs
|
|
|
|
run: |
|
|
|
|
cd docs
|
|
|
|
sphinx-build -b spelling -n -q -W --keep-going -d _build/doctrees -D language=en_US -j auto . _build/spelling
|
2023-02-28 13:14:51 +01:00
|
|
|
|
|
|
|
blacken-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: blacken-docs
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.11'
|
|
|
|
- run: python -m pip install blacken-docs
|
|
|
|
- name: Build docs
|
|
|
|
run: |
|
|
|
|
cd docs
|
|
|
|
make black
|
|
|
|
RESULT=`cat _build/black/output.txt`
|
|
|
|
if [ "$RESULT" -gt 0 ]; then
|
|
|
|
echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"
|
|
|
|
fi;
|
|
|
|
exit $RESULT
|