Skip to content

feat(esp32p4-function-ev-board): Add new BSP component for `ESP32P4 F… #573

feat(esp32p4-function-ev-board): Add new BSP component for `ESP32P4 F…

feat(esp32p4-function-ev-board): Add new BSP component for `ESP32P4 F… #573

name: Build and Publish Documentation (Pushes)
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
jobs:
build-and-deploy-docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: 'pip'
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install doxygen graphviz texlive-full pandoc
pip install -r doc/requirements.txt
- name: Build Documentation (HTML)
run: |
cd doc
# ignore if the following command fails
build-docs -bs html -t esp32 -l en --project-path ../ --source-dir ./ --doxyfile_dir ./ || true
if [ -d _build/en/esp32/html ]; then
build_dir_from_doc=_build/en/esp32
build_dir_root=doc/_build/en/esp32
elif [ -d ../_build/en/esp32/html ]; then
build_dir_from_doc=../_build/en/esp32
build_dir_root=_build/en/esp32
else
echo "Unable to find generated documentation output directory." >&2
exit 1
fi
echo "DOC_BUILD_DIR_FROM_DOC=${build_dir_from_doc}" >> $GITHUB_ENV
echo "DOC_BUILD_DIR_ROOT=${build_dir_root}" >> $GITHUB_ENV
# copy the generated HTML files to the docs directory for GitHub Pages
mkdir -p ../docs
cp -r "${build_dir_from_doc}/html/"* ../docs/.
- name: Build Documentation (PDF)
run: |
cd doc
if sh ./build_latex_pdf.sh "${DOC_BUILD_DIR_FROM_DOC}/latex"; then
echo "PDF_GENERATED=true" >> $GITHUB_ENV
echo "Success: PDF documentation generated successfully."
else
rm -f "${DOC_BUILD_DIR_FROM_DOC}/latex/refman.pdf"
rm -f "${DOC_BUILD_DIR_FROM_DOC}/latex/espp_documentation.pdf"
echo "PDF_GENERATED=false" >> $GITHUB_ENV
# warn if the PDF was not generated successfully
echo "Warning: PDF documentation was not generated successfully."
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
force_orphan: true
- uses: actions/upload-artifact@v7
if: env.PDF_GENERATED == 'true'
with:
name: espp_documentation.pdf
path: ${{ env.DOC_BUILD_DIR_ROOT }}/latex/espp_documentation.pdf
- name: Attach files to release
uses: softprops/action-gh-release@v3
if: ${{ github.event.release && github.event.action == 'published' && env.PDF_GENERATED == 'true' }}
with:
files: |
${{ env.DOC_BUILD_DIR_ROOT }}/latex/espp_documentation.pdf