Migrate documentation to Quarto #710
Workflow file for this run
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: Build and publish documentation | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Set up Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install Bambi and all its dependencies | |
run: | | |
conda install -c conda-forge python-graphviz | |
conda install pip | |
pip install . | |
pip install .[dev] | |
pip install .[jax] | |
- name: Checkout gh-pages | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
path: docs/_build/html | |
- name: Test build docs | |
if: github.ref != 'refs/heads/main' && ! startsWith(github.ref, 'refs/tags') | |
run: BUILDDIR=_build/html/main make -C docs/ local | |
- name: Build docs | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') | |
run: | | |
sphinx-build docs docs/_build/html | |
touch docs/_build/html/.nojekyll | |
- name: Publish docs to gh-pages | |
# Only once from main or a tag | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') | |
# We pin to the SHA, not the tag, for security reasons. | |
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions | |
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/_build/html | |
keep_files: true |