-
-
Notifications
You must be signed in to change notification settings - Fork 60
80 lines (67 loc) · 2.4 KB
/
documentation_ghpages.yaml
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
79
80
---
name: Documentation to gh-pages
on:
schedule:
# only once every month, at the 23rd
# We can always force run this.
- cron: '37 10 23 * *'
workflow_dispatch:
jobs:
check_commit:
runs-on: ubuntu-latest
name: Checks for latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Print the latest commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: Check the latest commit is within 1 week
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="1 week" --max-count=1 ${{ github.sha }}) && echo "::set-output name=should_run::false"
build:
# check that a commit has actually been made and only run if a commit has been made within the last week
needs: check_commit
if: ${{ needs.check_commit.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
# The files submodule is required for viz documentation
submodules: true
# the files submodule uses lfs
lfs: true
fetch-tags: true
# This should generally not be required, but in the end it is just easier
- name: Ensure system dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: r-lib/actions/setup-pandoc@v2
- name: Install sisl + documentation dependencies
run: |
python -m pip install --progress-bar=off --upgrade pip
python -m pip install --progress-bar=off .[viz,docs]
- name: Build the documentation using the sisl-files as well
run: |
cd docs
SISL_NODES_EXPORT_VIS=t SISL_FILES_TESTS=${GITHUB_WORKSPACE}/files/tests make html
rm -rf build/html/_sources
touch build/html/.nojekyll
cd ..
# Deploy to github pages
- name: Deploy to github pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: docs/build/html
GITHUB_TOKEN: ${{ github.token }}