-
Notifications
You must be signed in to change notification settings - Fork 32
54 lines (46 loc) · 1.41 KB
/
create_html_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
# Create updated html pages for documentation
name: Create HTML
on:
push:
branches:
- master
- feature/create-html-workflow
jobs:
run_tests:
name: Create HTML Pages
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2023b # R2020a This is necessary to create the pages for types
- name: Create pages
uses: matlab-actions/run-command@v2
with:
command: |
addpath(genpath('tools'));
matnwb_setup;
matnwb_generateDocs;
matnwb_exportTutorials(ExportFormat=".html",RunLivescript=false);
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Push to gh-pages
run: |
mkdir -p gh-pages/docs
cp -r docs/html gh-pages/docs/
cd gh-pages
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
git config user.email "<>"
# Only proceed with commit and push if changes are detected
if [[ $(git add . --dry-run | wc -l) -gt 0 ]]; then
git add .
git commit -m "Update html pages"
git push -f
else
echo "Nothing to commit"
fi