Put the engine logo in the backlink from outputs #10
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] | |
tags: ["*"] | |
pull_request: | |
# Check all PR | |
concurrency: | |
group: docs-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: setup rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: install dependencies | |
run: | | |
python -m pip install tox | |
sudo apt install doxygen | |
- name: build documentation | |
env: | |
# Use the CPU only version of torch when building/running the code | |
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
run: tox -e docs | |
- name: store documentation as github artifact to be downloaded by users | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: docs/build/html/* | |
overwrite: true # only keep the latest version of the documentation | |
- name: put documentation in the website | |
run: | | |
git clone https://github.com/metatensor/docs metatensor-docs | |
rm -rf metatensor-docs/.git | |
cd metatensor-docs | |
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2) | |
if [[ "$REF_KIND" == "tags" ]]; then | |
TAG=${GITHUB_REF#refs/tags/} | |
mv ../docs/build/html $TAG | |
else | |
rm -rf latest | |
mv ../docs/build/html latest | |
fi | |
- name: deploy to metatensor-docs | |
if: github.event_name == 'push' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
external_repository: metatensor/docs | |
deploy_key: ${{ secrets.METATENSOR_DOCS_SSH_KEY }} | |
publish_branch: main | |
publish_dir: ./metatensor-docs/ | |
force_orphan: true |