Skip to content

[pre-commit.ci] pre-commit autoupdate #49

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #49

Workflow file for this run

# This workflow will build the docs and publish them to GitHub Pages/Read the Docs.
name: Build Docs with Sphinx and Publish
on:
push:
branches: [ doc, dev ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
# Don't run on forked repos.
if: github.repository_owner == 'DeepPSP'
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v6
- name: Install system libraries
run: |
sudo apt update
sudo apt install build-essential ffmpeg libsm6 libxext6 libsndfile1 wget -y
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel hatch
pip install -e .[dev]
pip list
- name: Build docs with Sphinx and check for errors
run: |
cd docs
make html
make linkcheck
# Publish to GitHub Pages
- name: Publish to GitHub Pages
# publish only when pushed to the 'doc' branch or manually triggered
if: (github.event_name == 'push' && github.ref == 'refs/heads/doc') || (github.event_name == 'workflow_dispatch')
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
publish_branch: gh-pages
user_name: 'WEN Hao'
user_email: 'wenh06@gmail.com'