Repository: modin-project/modin
Pull request: FIX-#5993: Fix documentation building in CI
<!--
Thank you for your contribution!
Please review the contributing docs: https://modin.readthedocs.io/en/latest/development/contributing.html
if you have questions about contributing.
-->

## What do these changes do?

<!-- Please give a short brief about these changes. -->

- [x] first commit message and PR title follow format outlined [here](https://modin.readthedocs.io/en/latest/development/contributing.html#commit-message-formatting)
  > **_NOTE:_**  If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.
- [x] passes `flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] passes `black --check modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] signed commit with `git commit -s` <!-- you can amend your commit with a signature via `git commit -amend -s` -->
- [x] Resolves #5993  <!-- issue must be created for each patch -->
- [ ] tests added and passing
- [x] module layout described at `docs/development/architecture.rst` is up-to-date <!-- if you have added, renamed or removed files or directories please update the documentation accordingly -->


Problem statement:
Documentation build fails on master
```
(modin) \OneDrive - Intel Corporation\Desktop\REPOS\modin\docs>sphinx-build -T -E -W -b html . build
Traceback (most recent call last):
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\cmd\build.py", line 281, in build_main
    app.build(args.force_all, args.filenames)
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\application.py", line 347, in build
    self.builder.build_update()
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\builders\__init__.py", line 310, in build_update
    self.build(to_build,
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\builders\__init__.py", line 326, in build
    updated_docnames = set(self.read())
  File "\Miniconda3\envs\modin\lib\contextlib.py", line 120, in __exit__
    next(self.gen)
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\util\logging.py", line 218, in pending_warnings
    memhandler.flushTo(logger)
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\util\logging.py", line 183, in flushTo
    logger.handle(record)
  File "\Miniconda3\envs\modin\lib\logging\__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "\Miniconda3\envs\modin\lib\logging\__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "\Miniconda3\envs\modin\lib\logging\__init__.py", line 950, in handle
    rv = self.filter(record)
  File "\Miniconda3\envs\modin\lib\logging\__init__.py", line 811, in filter
    result = f.filter(record)
  File "\Miniconda3\envs\modin\lib\site-packages\sphinx\util\logging.py", line 426, in filter
    raise exc
sphinx.errors.SphinxWarning: \OneDrive - Intel Corporation\Desktop\REPOS\modin\docs\usage_guide\integrations.rst:2:Duplicate explicit target name: "jupyter notebook".

Warning, treated as error:
\modin\docs\usage_guide\integrations.rst:2:Duplicate explicit target name: "jupyter notebook".
```

Hints from issue discussion:

Commit message: FIX-#5993: Fix documentation building

Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>

Patch to review:
diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
new file mode 100644
index 00000000000..f36edcc8eef
--- /dev/null
+++ b/.github/workflows/build-docs.yml
@@ -0,0 +1,31 @@
+name: build-docs
+on:
+  pull_request:
+    paths:
+      - .github/workflows/**
+      - docs/**
+  push:
+concurrency:
+  # Cancel other jobs in the same branch. We don't care whether CI passes
+  # on old commits.
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
+jobs:
+  build-docs:
+    if: github.event_name == 'pull_request'
+    name: build docs
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 1
+      - uses: actions/setup-python@v4
+        with:
+          python-version: "3.8.x"
+          architecture: "x64"
+          cache: "pip"
+          cache-dependency-path: '**/requirements-doc.txt'
+      - run: pip install -r docs/requirements-doc.txt
+      - run: cd docs && sphinx-build -T -E -W -b html . build
+env:
+  MODIN_GITHUB_CI: true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1c9f116cc7e..582595263ab 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,23 +54,6 @@ jobs:
       - run: pip install -r requirements-dev.txt
       - run: mypy --config-file mypy.ini
 
-  build-docs:
-    if: github.event_name == 'pull_request'
-    name: build docs
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-      - uses: actions/setup-python@v4
-        with:
-          python-version: "3.8.x"
-          architecture: "x64"
-          cache: "pip"
-          cache-dependency-path: '**/requirements-doc.txt'
-      - run: pip install -r docs/requirements-doc.txt
-      - run: cd docs && sphinx-build -T -E -W -b html . build
-
   lint-pydocstyle:
     if: github.event_name == 'pull_request'
     name: lint (pydocstyle)
diff --git a/docs/usage_guide/integrations.rst b/docs/usage_guide/integrations.rst
index 53f84c52eff..9e82fcd7694 100644
--- a/docs/usage_guide/integrations.rst
+++ b/docs/usage_guide/integrations.rst
@@ -91,7 +91,7 @@ A Deeper Dive
 **seaborn**
 -----------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/seaborn.ipynb>`_
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/seaborn.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5435 
@@ -100,7 +100,7 @@ Github Issues
 **plotly**
 ----------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/plotly.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/plotly.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5447 
@@ -109,13 +109,13 @@ Github Issues
 **matplotlib**
 --------------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/matplotlib.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/matplotlib.ipynb>`__
 
 
 **altair**
 ----------
 
-`Jupyter Notebook <https://github.com/lmodin-project/modin/blob/master/examples/jupyter/integrations/altair.ipynb>`_ 
+`Jupyter Notebook <https://github.com/lmodin-project/modin/blob/master/examples/jupyter/integrations/altair.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5438
@@ -123,7 +123,7 @@ Github Issues
 **bokeh**
 ---------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/bokeh.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/bokeh.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5437
@@ -131,17 +131,17 @@ Github Issues
 **sklearn**
 -----------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/sklearn.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/sklearn.ipynb>`__
 
 **Hugging Face**
 ----------------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/huggingface.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/huggingface.ipynb>`__
 
 **Tensorflow**
 --------------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/tensorflow.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/tensorflow.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5439
@@ -149,17 +149,17 @@ Github Issues
 **NLTK**
 ---------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/NLTK.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/NLTK.ipynb>`__
 
 **XGBoost**
 -----------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/xgboost.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/xgboost.ipynb>`__
 
 **statsmodels**
 ---------------
 
-`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/statsmodels.ipynb>`_ 
+`Jupyter Notebook <https://github.com/modin-project/modin/blob/master/examples/jupyter/integrations/statsmodels.ipynb>`__
 
 Github Issues
     * https://github.com/modin-project/modin/issues/5440


Code review comments:
diff_hunk: @@ -0,0 +1,31 @@
+name: build-docs
+on:
+  pull_request:
+    paths:
+      - .github/workflows/**
+      - docs/**
+  push:
+concurrency:
+  # Cancel other jobs in the same branch. We don't care whether CI passes
+  # on old commits.
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
+jobs:
+  build-docs:
+    if: github.event_name == 'pull_request'
path: .github/workflows/build-docs.yml
text: @user1:
```suggestion
```

@author:
I've copied this straight from ci.yml. Are you sure that's redundant?

@author:
checked other yamls and this really seems redundant

diff_hunk: @@ -0,0 +1,31 @@
+name: build-docs
+on:
+  pull_request:
+    paths:
+      - .github/workflows/**
+      - docs/**
+  push:
path: .github/workflows/build-docs.yml
text: @user1:
```suggestion
```

@author:
I've copied this straight from ci.yml. Are you sure that's redundant?

@author:
checked other yamls and this really seems redundant

diff_hunk: @@ -0,0 +1,31 @@
+name: build-docs
+on:
+  pull_request:
+    paths:
+      - .github/workflows/**
+      - docs/**
+  push:
+concurrency:
+  # Cancel other jobs in the same branch. We don't care whether CI passes
+  # on old commits.
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
+jobs:
+  build-docs:
+    if: github.event_name == 'pull_request'
+    name: build docs
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 1
+      - uses: actions/setup-python@v4
+        with:
+          python-version: "3.8.x"
+          architecture: "x64"
+          cache: "pip"
+          cache-dependency-path: '**/requirements-doc.txt'
+      - run: pip install -r docs/requirements-doc.txt
+      - run: cd docs && sphinx-build -T -E -W -b html . build
+env:
+  MODIN_GITHUB_CI: true
path: .github/workflows/build-docs.yml
text: @user1:
Not sure if this is needed.
```suggestion
```

@author:
This line is also present in the `check-pr-title` 
https://github.com/modin-project/modin/blob/ff53445e1baa916d4b4ac6f2ecab21b86f5ccf02/.github/workflows/ci-required.yml#L17-L18

IMO this is redundant, however, I just wanted to be consistent with other yamls

@user1:
ok