-
-
Notifications
You must be signed in to change notification settings - Fork 60
88 lines (73 loc) · 2.51 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
81
82
83
84
85
86
87
88
---
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:
- id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v2
# 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
- name: Ensure fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 11
- 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 .[analysis,viz,docs]
- name: Build the documentation using the sisl-files as well
env:
SISL_NUM_PROCS: ${{ steps.cpu-cores.outputs.count }}
SISL_NODES_EXPORT_VIS: t
SISL_FILES_TESTS: ${{ github.workspace }}/files/tests
run: |
cd docs
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 }}