Skip to content

Update create_html_pages.yml #18

Update create_html_pages.yml

Update create_html_pages.yml #18

# 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: Start virtual display server
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb
Xvfb :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a # R2020a This is necessary to create the pages for types
- name: Create pages
uses: matlab-actions/run-command@v2
with:
startup-options: -batch
command: |
addpath(genpath('tools'));
disp('Display environment:')
disp(getenv('DISPLAY'))
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