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

View File

@ -6,7 +6,15 @@
SPHINXOPTS ?= SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build SPHINXBUILD ?= sphinx-build
SOURCEDIR = . 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". # Put it first so that "make" without argument is like "make help".
help: help:

View File

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

View File

@ -8,7 +8,14 @@ if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build set SPHINXBUILD=sphinx-build
) )
set SOURCEDIR=. 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 %SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 ( if errorlevel 9009 (