Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build gh-pages

on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- '**'

jobs:
build-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y doxygen sed git python3

- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout gh-pages
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: gh-pages
path: gh-pages

- name: Mark working directory as safe
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- name: Build gh-pages
shell: bash
run: |
BUILDDIR=$(pwd)/docs
GH_PAGES_DIR_NAME=$(pwd)/gh-pages
SAFE_BRANCH=$(echo "${GITHUB_REF_NAME}" | tr '/' '-')
DOCS=${GH_PAGES_DIR_NAME}/${SAFE_BRANCH}

install -d ${BUILDDIR}
rm -rf "${BUILDDIR}/html"
rm -rf "${DOCS}"

doxygen doxygen.cfg
touch "${BUILDDIR}/html/.nojekyll"
mv "${BUILDDIR}/html" ${DOCS}

cd "${GH_PAGES_DIR_NAME}" && python3 ../docs/create_directory_listing.py

# add updated branch listing
cp ${BUILDDIR}/*.css ${GH_PAGES_DIR_NAME}/
cp ${BUILDDIR}/index.html ${GH_PAGES_DIR_NAME}/

git config user.name "Robert Burger"
git config user.email "robert.burger@dlr.de"

git add index.html content.html navtree.css main.css "${SAFE_BRANCH}/*"
git commit -m 'Automatic update of GH pages' || echo "No changes to commit"

# Push to gh-pages branch, force update
if ! git diff --quiet; then
git push origin HEAD:gh-pages --force
else
echo "No changes to push"
fi

6 changes: 3 additions & 3 deletions Makefile.doc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
DOXYFILE = doxygen.cfg
SOURCEDIR = ./
BUILDDIR = $(SOURCEDIR)/doc
BUILDDIR = $(SOURCEDIR)/docs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While changing BUILDDIR to docs is consistent with the other changes, this change highlights a critical issue later in the gh-pages target. The commands on lines 29-30 use $(BUILDDIR) to copy CSS and HTML files:

29:	cp $(BUILDDIR)/*.css $(GH_PAGES_DIR_NAME)/
30:	cp $(BUILDDIR)/index.html $(GH_PAGES_DIR_NAME)/

However, the Doxygen output is generated into $(BUILDDIR)/html (based on doxygen.cfg), and this directory is moved to $(DOCS) on line 26. Consequently, the cp commands on lines 29-30 will fail because the source files do not exist in $(BUILDDIR). This will break the gh-pages deployment.

This appears to be a pre-existing issue, but since you are modifying BUILDDIR, it's a good opportunity to fix it. The fix might involve copying the files from $(BUILDDIR)/html before the mv command, or from $(DOCS) after it.

GH_PAGES_DIR_NAME = gh-pages
BRANCH_DIR_NAME = $(subst /,_,$(BRANCH_NAME))
BUILDCMD = cissy run -c $(SOURCEDIR) -p doxygen/[~=1.8]@3rdparty/stable doxygen
Expand All @@ -21,10 +21,10 @@ gh-pages:
install -d $(BUILDDIR)
rm -rf "$(BUILDDIR)/html"
rm -rf "$(DOCS)"
make -f Makefile.doc doc/html
make -f Makefile.doc docs/html
touch "$(BUILDDIR)/html/.nojekyll"
mv "$(BUILDDIR)/html" $(DOCS)
cd "$(GH_PAGES_DIR_NAME)" && python3 ../doc/create_directory_listing.py
( cd "$(GH_PAGES_DIR_NAME)" && python3 ../docs/create_directory_listing.py )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line correctly calls the Python script to generate the directory listing. However, the script create_directory_listing.py appears to have a couple of issues:

  1. It writes <!DOCTYPE html> at the beginning of content.html. If content.html is a fragment to be included in another page, it should not contain a DOCTYPE declaration.
  2. The generated <a> tags have class="index.html", which is likely a mistake and should be a more descriptive class name (e.g., class="branch-link").

Since this line is being modified, it would be a good time to also fix the script it calls to ensure valid HTML is generated.

# add updated branch listing
cp $(BUILDDIR)/*.css $(GH_PAGES_DIR_NAME)/
cp $(BUILDDIR)/index.html $(GH_PAGES_DIR_NAME)/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ GENERATE_HTML = YES
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_OUTPUT = doc/html
HTML_OUTPUT = docs/html

# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
Expand Down Expand Up @@ -1330,7 +1330,7 @@ HTML_STYLESHEET =
# documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_EXTRA_STYLESHEET = doc/doxygen_theme_flat_design/src/doxygen-style.css
HTML_EXTRA_STYLESHEET = docs/doxygen_theme_flat_design/src/doxygen-style.css

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The path to the stylesheet is updated correctly. However, I've noticed a potential issue within the referenced stylesheet docs/doxygen_theme_flat_design/src/doxygen-style.css. On line 5 of that file, it uses ::root to define CSS variables. The correct CSS pseudo-class is :root (with a single colon). Using the invalid ::root selector will prevent the CSS variables from being defined, which will likely break the custom theme's appearance.



# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
Expand Down Expand Up @@ -1576,7 +1576,7 @@ QHP_NAMESPACE = org.doxygen.Project
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.

QHP_VIRTUAL_FOLDER = doc
QHP_VIRTUAL_FOLDER = docs

# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
Expand Down Expand Up @@ -1902,7 +1902,7 @@ GENERATE_LATEX = NO
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.

LATEX_OUTPUT = doc/latex
LATEX_OUTPUT = docs/latex

# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
Expand Down