Skip to content

Commit

Permalink
doc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Feb 13, 2024
1 parent ea9cb21 commit 48c3e97
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build the documentation

on:
workflow_dispatch:

push:

pull_request:
branches: [main]

permissions:
contents: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser
- name: Build the documentation with Sphinx
run: |
pip install -e .
sphinx-build -b html docs/source docs/build/html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true

0 comments on commit 48c3e97

Please sign in to comment.