-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (88 loc) · 3.16 KB
/
Copy pathbuildSite.yml
File metadata and controls
104 lines (88 loc) · 3.16 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Job to build the html docs for ghpages
#
# (Current) Assumptions:
# * built wheels are available using saveNameWheel
# * built conda channel availabe using saveNameConda
#
# Effects: A ghpages specific artifact containing the built site is saved.
name: Build ghpages site
on:
workflow_call:
inputs:
# The name of the artifact containing the wheels
saveNameWheel:
required: true
type: string
# The name of the artifact containing the conda channel
saveNameConda:
required: true
type: string
# The name of the artifact containing the example notebooks built for the site
saveNameNotebooks:
required: true
type: string
workflow_dispatch:
inputs:
# The name of the artifact containing the wheels
saveNameWheel:
required: true
type: string
# The name of the artifact containing the conda channel
saveNameConda:
required: true
type: string
# The name of the artifact containing the example notebooks built for the site
saveNameNotebooks:
required: true
type: string
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# This should prep pip to use cached downloads
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml
- uses: actions/download-artifact@v3
with:
name: ${{inputs.saveNameWheel}}
- name: validate wheel presence
# test -z checks if the input is a zero length string.
# The results of the find operation are packed into a string;
# if not wheels are found, abort this action so we don't
# build and deploy an empty site.
run: if test -z "$(find . -maxdepth 1 -name "*.whl")"; then exit 1; fi
- name: Move Wheels to docs source
run: mv *.whl ./documentation/source/wheels
- name: install nimble and dependencies for examples building
run: |
pip install nimble[quickstart] --find-links=./documentation/source/wheels
pip install keras tensorflow
- name: Install docs specific python dependencies
run: pip install -r ./documentation/requirements.txt
- name: Install pandoc system dependency via action
uses: pandoc/actions/setup@v1
with:
version: 2.19
- name: Build site
# our cwd is the project root, we -C to indicate the folder we want to build from/in
run: make html -C documentation
# save the converted notebooks of the site examples
- uses: actions/upload-artifact@v3
with:
name: ${{inputs.saveNameNotebooks}}
path: ./documentation/html/examples
retention-days: 1
# pull previously created conda channel into the build site folder
- uses: actions/download-artifact@v3
with:
name: ${{inputs.saveNameConda}}
path: ./documentation/html/nimble-data
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./documentation/html
retention-days: 1