Skip to content

projects: ltc2672: Release ltc2672 firmware #2

projects: ltc2672: Release ltc2672 firmware

projects: ltc2672: Release ltc2672 firmware #2

name: Documentation
on:
push:
branches:
- main
pull_request:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install -r doc/sphinx/requirements.txt
sudo apt-get install doxygen graphviz -y
- name: Sphinx build
run: |
pushd doc/sphinx
sphinx-build ./ build
popd
echo "Sphinx was generated successfully!"
- name: Store the generated doc
uses: actions/upload-artifact@v4
with:
name: html-sphinx
path: doc/sphinx/build
- name: Doxygen build
run: |
pushd doc/doxygen
mkdir -p build
cd build
cmake ../
doxygen doxygen_doc/Doxyfile.doxy
cd ..
popd
echo "Doxygen was generated successfully!"
- name: Store the generated doc
uses: actions/upload-artifact@v4
with:
name: html-doxygen
path: doc/doxygen/build/html
deploy-doc:
runs-on: ubuntu-latest
needs: build-docs
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
ref: 'gh-pages'
- name: Empty gh-pages
run: |
git rm -r . --quiet
- uses: actions/download-artifact@v4
with:
name: html-sphinx
- uses: actions/download-artifact@v4
with:
name: html-doxygen
path: doxygen
- name: Patch doc build
run: |
touch .nojekyll
- name: Commit gh-pages
run: |
author=$(git log -1 --pretty=format:'%an')
email=$(git log -1 --pretty=format:'%ae')
commit=$(git rev-parse --short HEAD)
git add . >> /dev/null
git config --global user.name "$author"
git config --global user.email "$email"
git commit -m "deploy: $commit" --allow-empty
- name: Push to gh-pages
run: >-
git push origin gh-pages:gh-pages