-
Notifications
You must be signed in to change notification settings - Fork 14
43 lines (38 loc) · 1.18 KB
/
docs.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
name: Build and Deploy Documentation
on:
push:
branches:
- main
pull_request:
branches: [main]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mhkit-docs
environment-file: environment.yml
auto-activate-base: false
- name: Build Documentation
shell: bash -l {0}
run: |
cd docs
rm -rf _build/*
sphinx-build -b html source _build/html
# Create .nojekyll file to prevent GitHub Pages from ignoring files that begin with an underscore
touch _build/html/.nojekyll
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
force_orphan: true
enable_jekyll: false
full_commit_message: ${{ github.event.head_commit.message }}