-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.19 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Documentation
on:
push:
branches: [main]
tags: ["*"]
pull_request:
# Check all PR
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
pull-requests: write
jobs:
build-and-publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Comment with download link
uses: PicoCentauri/comment-artifact@v1
if: github.event.pull_request.head.repo.fork == false
with:
name: docs
description: 📚 Download documentation for this pull-request
# - 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