-
Notifications
You must be signed in to change notification settings - Fork 23
69 lines (55 loc) · 2.05 KB
/
gh-pages.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
# Workflow name
name: "Documentation Build"
on:
push:
branches:
- main
# UNCOMMENT TO DEBUG DOCUMENTATION
# pull_request:
# branches:
# - main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# Use bash instead of sh for conda activation
defaults:
run:
shell: bash -l {0}
# Task to do when launching the workflow
steps:
# 1. First get the repository source
- name: "Checkout"
uses: actions/checkout@v3
# 2. Setup virtual environment with mamba
# See https://github.com/conda-incubator/setup-miniconda#caching-environments
- name: Setup a conda-incubator with an empty conda env
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9.12
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
# Environment to create and activate for next steps
activate-environment: myria3d
- name: Cache conda environment based on dependencies.
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ hashFiles('environment.yml') }}
id: cache
- name: Update the (currently empty) myria3d environment, if a cache cannot be found.
if: steps.cache.outputs.cache-hit != 'true'
run: mamba env update -n myria3d -f environment.yml
- name: "Build documentation"
working-directory: ./docs/
run: |
# Tell torch_geometric where to find cuda
export LD_LIBRARY_PATH="/usr/share/miniconda3/envs/myria3d/lib:$LD_LIBRARY_PATH"
make html
# 3. Déploy on Github Pages
- name: "Deploy documentation on Github pages"
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages # <- Branch where generated doc files will be commited
# BRANCH: gh-pages-DEBUG # <-- UNCOMMENT TO DEBUG DOCUMENTATION
FOLDER: docs/build/html/ # <- Dir where .nojekyll is created and from which to deploy github pages.