[pre-commit.ci] pre-commit autoupdate #241
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: Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
CMAKE_VERSION: 3.16.x | |
CMAKE_BUILD_TYPE: Release | |
CMAKE_BUILD_PREFIX: ./build | |
CMAKE_INSTALL_PREFIX: ./install | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
name: π Docs | |
steps: | |
- name: π§° Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: π¨ Install packages | |
run: sudo apt-get install dia mscgen inkscape | |
- name: π Install Conda environment | |
uses: mamba-org/provision-with-micromamba@v16 | |
with: | |
environment-file: .github/micromamba/docs.yml | |
- name: π¨ Install miktex | |
run: | | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D6BC243565B2087BC3F897C9277A7293F59E4889 | |
echo "deb http://miktex.org/download/ubuntu focal universe" | sudo tee /etc/apt/sources.list.d/miktex.list | |
sudo apt-get update | |
sudo apt-get install miktex | |
sudo miktexsetup --shared=yes finish | |
sudo initexmf --admin --set-config-value [MPM]AutoInstall=1 | |
- name: π¨ Setup CMake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{env.CMAKE_VERSION}} | |
github-api-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π§ Configure | |
run: cmake -S . -B ${{ env.CMAKE_BUILD_PREFIX }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DBUILD_DOCS=ON -DCMAKE_PREFIX_PATH="~/micromamba" | |
- name: βοΈ Build | |
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel 2 --target all docs | |
- name: π₯ Install | |
run: cmake --install ${{ env.CMAKE_BUILD_PREFIX }} --prefix ${{ env.CMAKE_INSTALL_PREFIX }} --strip | |
- name: Check PDF Manual | |
id: check_files | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/CMakeMM/pdf/CMakeMM_Manual.pdf | |
- name: Move PDF Manual | |
if: steps.check_files.outputs.files_exists == 'true' | |
run: mv ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/CMakeMM/pdf/CMakeMM_Manual.pdf ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/CMakeMM/html/CMakeMM_Manual.pdf | |
- name: π Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
ACCESS_TOKEN: ${{ secrets.REPOS_ACCESS }} | |
REPOSITORY_NAME: flagarde/docs | |
BRANCH: main | |
FOLDER: ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/CMakeMM/html/ | |
TARGET_FOLDER: CMakeMM |