mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-30 19:23:20 +08:00
Merge pull request #686 from Loup-Garou911XD/master
Added workflow for deploying docs to github pages
This commit is contained in:
commit
e19d6619b1
52
.github/workflows/deploy_docs.yml
vendored
Normal file
52
.github/workflows/deploy_docs.yml
vendored
Normal file
@ -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
|
||||
@ -195,6 +195,7 @@ ctx.filter_file_names = {
|
||||
'.editorconfig',
|
||||
'ci.yml',
|
||||
'cd.yml',
|
||||
'deploy_docs.yml',
|
||||
'LICENSE',
|
||||
'cloudtool',
|
||||
'bacloud',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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.')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user