docs: Separate conf.py

docs: update github actions

docs: fix Makefile tabs

Update docs-pr.yaml

Update Makefile

Closes #13323
This commit is contained in:
David Garcia
2023-03-24 15:22:20 +00:00
committed by Botond Dénes
parent 89e58963ab
commit 70ce1b2002
4 changed files with 24 additions and 16 deletions

View File

@@ -2,10 +2,14 @@ name: "Docs / Publish"
# For more information,
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
env:
FLAG: ${{ github.repository == 'scylladb/scylla-enterprise' && 'enterprise' || 'opensource' }}
on:
push:
branches:
- master
- 'master'
- 'enterprise'
paths:
- "docs/**"
workflow_dispatch:
@@ -24,12 +28,13 @@ jobs:
with:
python-version: 3.7
- name: Set up env
run: make -C docs setupenv
run: make -C docs FLAG="${{ env.FLAG }}" setupenv
- name: Build docs
run: make -C docs multiversion
run: make -C docs FLAG="${{ env.FLAG }}" multiversion
- name: Build redirects
run: make -C docs redirects
run: make -C docs FLAG="${{ env.FLAG }}" redirects
- name: Deploy docs to GitHub Pages
run: ./docs/_utils/deploy.sh
if: (github.ref_name == 'master' && env.FLAG == 'opensource') || (github.ref_name == 'enterprise' && env.FLAG == 'enterprise')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,10 +2,14 @@ name: "Docs / Build PR"
# For more information,
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
env:
FLAG: ${{ github.repository == 'scylladb/scylla-enterprise' && 'enterprise' || 'opensource' }}
on:
pull_request:
branches:
- master
- enterprise
paths:
- "docs/**"
@@ -23,6 +27,6 @@ jobs:
with:
python-version: 3.7
- name: Set up env
run: make -C docs setupenv
run: make -C docs FLAG="${{ env.FLAG }}" setupenv
- name: Build docs
run: make -C docs test
run: make -C docs FLAG="${{ env.FLAG }}" test

View File

@@ -7,13 +7,20 @@ PAPER :=
BUILDDIR := _build
SOURCEDIR := .
PREVIEW_HOST := 127.0.0.1
FLAG := opensource
CONF_PATH := ./
# Internal variables
ifeq ($(FLAG), enterprise)
CONF_PATH = ./_enterprise
endif
PAPEROPT_a4 := -D latex_paper_size=a4
PAPEROPT_letter := -D latex_paper_size=letter
ALLSPHINXOPTS := -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
ALLSPHINXOPTS := -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR) -t $(FLAG) -c $(CONF_PATH)
TESTSPHINXOPTS := $(ALLSPHINXOPTS) -W --keep-going
PROD_OPTS := -D html_theme_options.collapse_navigation='false' -D html_theme_options.navigation_depth=3
PROD_OPTS := -D html_theme_options.collapse_navigation='false' -D html_theme_options.navigation_depth=3 -t $(FLAG) -c $(CONF_PATH)
# Windows variables
ifeq ($(OS),Windows_NT)

View File

@@ -22,8 +22,6 @@ LATEST_VERSION = "branch-5.1"
UNSTABLE_VERSIONS = ["master", "branch-5.2"]
# Set which versions are deprecated.
DEPRECATED_VERSIONS = [""]
# Set to enterprise or opensource.
FLAGS = ["opensource"]
# -- General configuration ------------------------------------------------
@@ -141,13 +139,7 @@ html_context = {"html_baseurl": html_baseurl}
# -- Initialize Sphinx ----------------------------------------------
def builder_inited(app):
# Add custom flags
for flag in FLAGS:
app.tags.add(flag)
def setup(sphinx):
sphinx.connect('builder-inited', builder_inited)
warnings.filterwarnings(
action="ignore",
category=UserWarning,