diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml new file mode 100644 index 000000000..4e3d756a2 --- /dev/null +++ b/.github/workflows/build_docs.yaml @@ -0,0 +1,31 @@ +name: Build and deploy documentation +on: + push: + branches: + - docs +jobs: + build-docs: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ['3.10'] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y pandoc + python -m pip install -e .[development] + - name: Build docs + run: cd doc && make html + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/build/html diff --git a/.github/workflows/docs_check.yaml b/.github/workflows/docs_check.yaml new file mode 100644 index 000000000..ab81da256 --- /dev/null +++ b/.github/workflows/docs_check.yaml @@ -0,0 +1,31 @@ +name: Check for Sphinx Warnings + +on: + pull_request: + paths: + - "doc/**" + - "**/*.rst" + - ".github/workflows/docs_check.yaml" + - "setup.py" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[development] + + - name: Check for Sphinx warnings + run: | + sphinx-build -M html ./doc/source ./doc/_build --fail-on-warning