From ffd39ed59c34dcfe445d740090def1f27261a462 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 01:51:11 +0530 Subject: [PATCH 01/14] Added workflow for deploying docs to github pages --- .github/workflows/deploy_docs.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy_docs.yml diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml new file mode 100644 index 00000000..ceaf834a --- /dev/null +++ b/.github/workflows/deploy_docs.yml @@ -0,0 +1,34 @@ +name: Deploy Documentation + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + # Remove this once we upgrade to 3.12. + + - name: Install typing_extensions (temp) + run: python3.11 -m pip install typing_extensions + + - name: Install pip requirements + run: tools/pcommand install_pip_reqs + + - name: Build documentation + run: make docs-sphinx + + - name: Deploy documentation + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: build/sphinx From e436ed8ed5447977422958eb2af29f52e79e86a2 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 01:56:13 +0530 Subject: [PATCH 02/14] ci fix --- config/spinoffconfig.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/spinoffconfig.py b/config/spinoffconfig.py index 4632332a..f4da7124 100644 --- a/config/spinoffconfig.py +++ b/config/spinoffconfig.py @@ -195,6 +195,7 @@ ctx.filter_file_names = { '.editorconfig', 'ci.yml', 'cd.yml', + 'deploy_docs.yml', 'LICENSE', 'cloudtool', 'bacloud', From e0427f67c79b8eec02dfeaf14fdd0e073c4d5000 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 02:11:22 +0530 Subject: [PATCH 03/14] no jekyll fix --- .github/workflows/deploy_docs.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index ceaf834a..f1b799e0 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -26,7 +26,12 @@ jobs: - name: Build documentation run: make docs-sphinx - + + - name: No jekyll + run: touch build/sphinx/.nojekyll + # without this, github thinks we are using jekyll + # and doesn't let us access files and dirs with _ + - name: Deploy documentation uses: peaceiris/actions-gh-pages@v3 with: From 3761457f58939d90f68639abc9aec1bb0852bebb Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 02:24:33 +0530 Subject: [PATCH 04/14] Deploy Documentation workflow can be triggered manually --- .github/workflows/deploy_docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index f1b799e0..23a76a3a 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -4,7 +4,8 @@ on: push: branches: - main - + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest From 349cf5ae1006b6d304f56b087acdde8e248c79f1 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 02:54:57 +0530 Subject: [PATCH 05/14] now using deploy-pages action --- .github/workflows/deploy_docs.yml | 43 +++++++++++++++++++------------ 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 23a76a3a..f7fcb17b 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -5,36 +5,47 @@ on: branches: - main workflow_dispatch: - + jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Python uses: actions/setup-python@v5 with: python-version: '3.11' # Remove this once we upgrade to 3.12. - - name: Install typing_extensions (temp) run: python3.11 -m pip install typing_extensions - - name: Install pip requirements run: tools/pcommand install_pip_reqs - - name: Build documentation - run: make docs-sphinx - - - name: No jekyll - run: touch build/sphinx/.nojekyll - # without this, github thinks we are using jekyll - # and doesn't let us access files and dirs with _ - - - name: Deploy documentation - uses: peaceiris/actions-gh-pages@v3 + run: make docs-sphinx + - name: Upload the build + uses: actions/upload-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: build/sphinx + name: sphinx_html_docs + path: build/sphinx + + deploy: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action \ No newline at end of file From 9b40b7c080d3f71542e0ba29e4ccf1df6948d92b Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 02:58:47 +0530 Subject: [PATCH 06/14] added artifact name --- .github/workflows/deploy_docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index f7fcb17b..be27a507 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -48,4 +48,5 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment + artifact_name: sphinx_html_docs uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action \ No newline at end of file From 07dc5ca2021b3a0cfb42bb4194f33fa5fa5fbc20 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:11:43 +0530 Subject: [PATCH 07/14] yeah --- .github/workflows/deploy_docs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index be27a507..b91ce6f0 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -24,7 +24,7 @@ jobs: - name: Build documentation run: make docs-sphinx - name: Upload the build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sphinx_html_docs path: build/sphinx @@ -48,5 +48,6 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - artifact_name: sphinx_html_docs - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action \ No newline at end of file + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action + with: + artifact_name: sphinx_html_docs \ No newline at end of file From eea123b9a2250ccbbdf06147131b180964decc68 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:27:17 +0530 Subject: [PATCH 08/14] hmm --- .github/workflows/deploy_docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index b91ce6f0..75272443 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -24,7 +24,7 @@ jobs: - name: Build documentation run: make docs-sphinx - name: Upload the build - uses: actions/upload-artifact@v4 + uses: actions/upload-pages-artifact@v4 with: name: sphinx_html_docs path: build/sphinx @@ -48,6 +48,6 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action + uses: actions/deploy-pages@v4 with: artifact_name: sphinx_html_docs \ No newline at end of file From b926d4b982ec450b449a9891ad1f4919dd30cd1b Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:27:34 +0530 Subject: [PATCH 09/14] oops --- .github/workflows/deploy_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 75272443..8edf61ad 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -24,7 +24,7 @@ jobs: - name: Build documentation run: make docs-sphinx - name: Upload the build - uses: actions/upload-pages-artifact@v4 + uses: actions/upload-pages-artifact@v3 with: name: sphinx_html_docs path: build/sphinx From 05fbac8a1caec981ebeb612cd9510b57aa341cb1 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:36:39 +0530 Subject: [PATCH 10/14] Test to see deployment on push --- src/assets/sphinx/static/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/sphinx/static/conf.py b/src/assets/sphinx/static/conf.py index 7dfdb1ad..3096fce1 100644 --- a/src/assets/sphinx/static/conf.py +++ b/src/assets/sphinx/static/conf.py @@ -31,7 +31,7 @@ html_logo = sphinx_settings['ballistica_logo'] if html_theme == 'furo': html_theme_options = { - 'announcement': 'This is a placeholder announcement', + # 'announcement': 'This is a placeholder announcement', 'light_css_variables': { 'color-brand-primary': '#3cda0b', 'color-brand-content': '#7C4DFF', From ba2b2b5d59aa372fa7c266c9ff0d11316327ee31 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:38:23 +0530 Subject: [PATCH 11/14] i thought main and master were synonymous --- .github/workflows/deploy_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 8edf61ad..aca7b338 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -3,7 +3,7 @@ name: Deploy Documentation on: push: branches: - - main + - master workflow_dispatch: jobs: From 40c40c4611234d6054b2cedbf257efe80748fb46 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 03:40:20 +0530 Subject: [PATCH 12/14] removed as won't be needed --- .github/workflows/deploy_docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index aca7b338..51fc1a85 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -4,7 +4,6 @@ on: push: branches: - master - workflow_dispatch: jobs: build: From ef2bb8574a3752b2dfa03e623923bd89a44c4178 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 28 Mar 2024 16:10:01 +0530 Subject: [PATCH 13/14] Added doctree dirw --- tools/batools/docs.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/batools/docs.py b/tools/batools/docs.py index a592f669..a6eafeff 100755 --- a/tools/batools/docs.py +++ b/tools/batools/docs.py @@ -320,16 +320,12 @@ def _run_sphinx( paths['static_dir'], paths['sphinx_cache_dir'], # input dir paths['build_dir'], # output dir - # enable after sphinx 7.3.0 is available on PyPi(pip) - # '--doctree-dir', paths['sphinx_cache_dir'], + '-d', + paths['sphinx_cache_dir'], # '-Q', #quiet now ], check=True, ) - # slows down build process when rebuilding, - # remove after sphinx 7.3.0 is available on PyPi(pip) - shutil.rmtree(paths['build_dir'] + '.doctrees') - duration = time.monotonic() - starttime print(f'Generated sphinx documentation in {duration:.1f}s.') From e1fc32c05cf09aad960faf0b24d6cf99f36a93a5 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 28 Mar 2024 19:35:10 +0530 Subject: [PATCH 14/14] Update docs.py --- tools/batools/docs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/batools/docs.py b/tools/batools/docs.py index a6eafeff..2a6c2051 100755 --- a/tools/batools/docs.py +++ b/tools/batools/docs.py @@ -230,7 +230,6 @@ def _run_sphinx( # pylint: disable=too-many-locals import time - import shutil from batools.version import get_current_version from jinja2 import Environment, FileSystemLoader