diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml new file mode 100644 index 00000000..51fc1a85 --- /dev/null +++ b/.github/workflows/deploy_docs.yml @@ -0,0 +1,52 @@ +name: Deploy Documentation + +on: + push: + branches: + - master + +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: Upload the build + uses: actions/upload-pages-artifact@v3 + with: + 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 + with: + artifact_name: sphinx_html_docs \ No newline at end of file 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', 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', diff --git a/tools/batools/docs.py b/tools/batools/docs.py index a592f669..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 @@ -320,16 +319,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.')