1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-26 18:46:04 +01:00

Try versions

This commit is contained in:
peteGSX 2025-02-05 09:58:48 +10:00
parent 3317890be4
commit 1a92e3d418
4 changed files with 42 additions and 16 deletions

View File

@ -2,7 +2,9 @@ name: Docs
on:
push:
branches: [ master-exraildoc ]
branches:
- master-exraildoc
- master-exraildocdev
pull_request:
branches: [ master ]
workflow_dispatch:
@ -11,17 +13,31 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Requirements
with:
fetch-depth: 0
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip3 install -r requirements.txt
sudo apt-get install doxygen
- name: Build docs
- name: Build Devel docs
run: |
git checkout master-exraildocdev
cd docs
make html
cd ..
- name: Build Prod docs
run: |
git checkout master-exraildoc
cd docs
make html
touch _build/html/.nojekyll
- name: Deploy
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6
with:

View File

@ -6,7 +6,15 @@
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# BUILDDIR = _build
# Determine build directory based on git branch
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(BRANCH),master-exraildocdev)
BUILDDIR = _build/devel
else
BUILDDIR = _build
endif
# Put it first so that "make" without argument is like "make help".
help:

View File

@ -53,7 +53,6 @@ numfig_format = {'figure': 'Figure %s'}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
@ -88,19 +87,15 @@ html_css_files = [
baseurl_prefix = 'https://dcc-ex.com/CommandStation-EX/'
# Change output directory depending on branch
if current_branch in ['master-exraildoc', 'master-exraildocdev']:
# Devel documentation needs to be a different directory
if current_branch == 'master-exraildocdev':
# For versioning
html_baseurl = f"{baseurl_prefix}{current_branch}/"
html_extra_path = ['_build']
builddir = os.path.join('_build', current_branch)
html_baseurl = f"{baseurl_prefix}devel/"
html_build_dir = os.path.abspath(os.path.join('_build', 'devel'))
else:
# Main landing page
html_baseurl = baseurl_prefix
builddir = '_build'
# Override default build directory
sphinx.builders.html.get_outfilename = lambda self, pagename: os.path.join(builddir, pagename + '.html')
html_build_dir = os.path.abspath('_build')
# Sphinx sitemap
html_extra_path = [

View File

@ -8,7 +8,14 @@ if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
@REM set BUILDDIR=_build
for /f "tokens=*" %%g in ('git rev-parse --abbrev-ref HEAD') do (set BRANCH=%%g)
if "%BRANCH%"=="master-exraildocdev" (
set BUILDDIR=_build\devel
) else (
set BUILDDIR=_build
)
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (