Merge pull request #18 from cmake-tools/pre-commit-ci-update-config #230
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] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install/Configure mamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ${{ github.workspace }}/.github/workflows/mamba/docs.yml | |
init-shell: bash | |
cache-environment: true | |
post-cleanup: all | |
environment-name: docs | |
- name: Install python packages | |
run: ${{ env.MAMBA_ROOT_PREFIX }}/envs/docs/bin/python -m pip install sphinxcontrib-moderncmakedomain | |
- name: 🟨 Install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
env: | |
TINYTEX_INSTALLER: TinyTeX-0 | |
- name: 🟨 Install LaTeX packages | |
run: | | |
tlmgr install latex-bin latex-tools-dev amsmath luatex85 hyperref polyglossia geometry cmap amsfonts luatexbase fncychap kvoptions float wrapfig capt-of framed fancyvrb upquote needspace tabulary varwidth colortbl booktabs parskip fancyhdr titlesec pdftexcmds infwarerr oberdiek epstopdf epstopdf-pkg | |
tlmgr list --only-installed | |
- name: ⬇️ Setup CMake | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: ^3 | |
- name: Run CMake | |
run: cmake -D CMAKE_PROGRAM_PATH=${{ env.MAMBA_ROOT_PREFIX }}/envs/docs/bin -S ${{ github.workspace }} -B ${{ github.workspace }}/build -G "Ninja Multi-Config" -Werror=dev -Werror=deprecated -DBUILD_TESTS=OFF -DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX | |
}}/envs/docs/ -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install | |
- name: Generate docs | |
run: cmake --build ${{ github.workspace }}/build --target docs-all --config Release | |
- name: Install docs | |
run: cmake --install ${{ github.workspace }}/build --config Release | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: ${{ github.workspace }}/install/share/doc/html/ | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |