From 32b97439312fb6ace04e21114db5f5b04c67c638 Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 09:44:19 +0200 Subject: [PATCH 1/8] Update doc build step. --- .github/workflows/ci_cd.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 9772daff3..482141808 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -71,7 +71,6 @@ jobs: # Only the tox environment specified in the tox.ini gh-actions is run run: tox - docs: name: Documentation runs-on: ubuntu-latest @@ -82,12 +81,11 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools tox - - name: Generate the documentation with tox - run: tox -e doc - + - name: Generate the documentation with sphinx + run: | + python build.py documentation + touch doc/build/html/.nojekyll + echo "dev.rep.docs.pyansys.com" >> doc/build/html/CNAME build: name: Build library From 4006f0ea0fa5eddf4351e4b86ab63972787c3488 Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:20:51 +0200 Subject: [PATCH 2/8] Add deploy step. --- .github/workflows/ci_cd.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 482141808..5491f4a70 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -86,6 +86,13 @@ jobs: python build.py documentation touch doc/build/html/.nojekyll echo "dev.rep.docs.pyansys.com" >> doc/build/html/CNAME + - name: Deploy Documentation + if: github.ref == 'refs/heads/main' + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages + folder: doc/build/html + clean: true build: name: Build library From 6f6caf526058f145c441d9a4aad8103b8d93f092 Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:22:59 +0200 Subject: [PATCH 3/8] Remove doc style check for now. --- .github/workflows/ci_cd.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 5491f4a70..1fbc70f0c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -31,23 +31,23 @@ jobs: - name: Test with tox run: tox -e style - docs-style: - name: Documentation Style Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Running Vale - uses: errata-ai/vale-action@reviewdog - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - files: doc - reporter: github-pr-check - level: error - filter_mode: nofilter - fail_on_error: true - vale_flags: "--config=doc/.vale.ini" + #docs-style: + # name: Documentation Style Check + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # + # - name: Running Vale + # uses: errata-ai/vale-action@reviewdog + # env: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # with: + # files: doc + # reporter: github-pr-check + # level: error + # filter_mode: nofilter + # fail_on_error: true + # vale_flags: "--config=doc/.vale.ini" tests: name: Tests and coverage From a2ae9e906b2e8f36487a46321adfcd5a16c29faf Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:24:02 +0200 Subject: [PATCH 4/8] Remove docs-style requirement for now. --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1fbc70f0c..11510af60 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -74,7 +74,7 @@ jobs: docs: name: Documentation runs-on: ubuntu-latest - needs: docs-style + # needs: docs-style steps: - uses: actions/checkout@v3 - name: Set up Python From 7c245bb87abab81d7d3637dc11516397ff8adbdd Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:27:41 +0200 Subject: [PATCH 5/8] Add env generation. --- .github/workflows/ci_cd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 11510af60..3047a6529 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -83,6 +83,8 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Generate the documentation with sphinx run: | + python build.py venv + source dev_env/bin/activate python build.py documentation touch doc/build/html/.nojekyll echo "dev.rep.docs.pyansys.com" >> doc/build/html/CNAME From b7515f2891a9aabd9995994a13c960dcc2ebc4ee Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:31:43 +0200 Subject: [PATCH 6/8] Adjust folder. --- .github/workflows/ci_cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 3047a6529..9e69ea1d0 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -86,14 +86,14 @@ jobs: python build.py venv source dev_env/bin/activate python build.py documentation - touch doc/build/html/.nojekyll - echo "dev.rep.docs.pyansys.com" >> doc/build/html/CNAME + touch build/sphinx/html/.nojekyll + echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME - name: Deploy Documentation if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@4.1.4 with: branch: gh-pages - folder: doc/build/html + folder: build/sphinx/html clean: true build: From 08e0c2404053f701786cc3285005afde878af663 Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:54:40 +0200 Subject: [PATCH 7/8] Switch to tox. --- .github/workflows/ci_cd.yml | 12 +++++------- tox.ini | 5 ++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 9e69ea1d0..44ad97400 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -81,13 +81,11 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Generate the documentation with sphinx - run: | - python build.py venv - source dev_env/bin/activate - python build.py documentation - touch build/sphinx/html/.nojekyll - echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools tox + - name: Generate the documentation with tox + run: tox -e doc - name: Deploy Documentation if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@4.1.4 diff --git a/tox.ini b/tox.ini index 9feb20e1c..2c8ccba78 100644 --- a/tox.ini +++ b/tox.ini @@ -43,4 +43,7 @@ description = Check if documentation generates properly deps = -r{toxinidir}/requirements/requirements_doc.txt commands = - sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxworkdir}/doc_out" --color -vW -bhtml + python prepare_documentation.py + python -m sphinx -b html doc/source build/sphinx/html + touch build/sphinx/html/.nojekyll + echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME From 3d379bd8e8124a04b4e88784b38fe57922278b49 Mon Sep 17 00:00:00 2001 From: jonathanzopes Date: Mon, 15 Aug 2022 10:57:30 +0200 Subject: [PATCH 8/8] Move gh-pages commands. --- .github/workflows/ci_cd.yml | 4 ++++ tox.ini | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 44ad97400..5347c8f73 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -86,6 +86,10 @@ jobs: python -m pip install --upgrade pip setuptools tox - name: Generate the documentation with tox run: tox -e doc + - name: Add gh-pages parameters + run: | + touch build/sphinx/html/.nojekyll + echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME - name: Deploy Documentation if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@4.1.4 diff --git a/tox.ini b/tox.ini index 2c8ccba78..ea92c3faa 100644 --- a/tox.ini +++ b/tox.ini @@ -45,5 +45,3 @@ deps = commands = python prepare_documentation.py python -m sphinx -b html doc/source build/sphinx/html - touch build/sphinx/html/.nojekyll - echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME