Case Optimization Refresh (#248) #147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
docs: | |
name: Build & Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# We build doxygen from source because of | |
# https://github.com/doxygen/doxygen/issues/9016 | |
- name: Build Doxygen | |
run: | | |
sudo apt install cmake ninja-build graphviz graphviz | |
git clone https://github.com/doxygen/doxygen.git ../doxygen | |
cmake -S ../doxygen -B ../doxygen/build -G Ninja | |
sudo ninja -C ../doxygen/build install | |
- name: Build Documentation | |
run: | | |
pip3 install fypp | |
cmake -S . -B build -G Ninja --install-prefix=$(pwd)/build/install -D MFC_DOCUMENTATION=ON | |
ninja -C build install | |
- name: Publish Documentation | |
run: | | |
set +e | |
git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q | |
if [ "$?" -ne "0" ]; then exit 0; fi | |
set -e | |
git config --global user.name 'MFC Action' | |
git config --global user.email '<>' | |
git clone "${{ secrets.DOC_PUSH_URL }}" ../www | |
rm -rf ../www/* | |
mv build/install/docs/mfc/* ../www/ | |
git -C ../www add -A | |
git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true | |
git -C ../www push | |
# DOC_PUSH_URL should be of the format: | |
# --> https://<username>:<token>@github.com/<username>/<repository> |