| 1 |
name: "Build Documentation" |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main # Set a branch name to trigger deployment |
| 6 |
pull_request: |
| 7 |
jobs: |
| 8 |
ci: |
| 9 |
strategy: |
| 10 |
fail-fast: false |
| 11 |
matrix: |
| 12 |
python-version: [3.12] |
| 13 |
os: [ubuntu-latest] |
| 14 |
runs-on: ${{ matrix.os }} |
| 15 |
permissions: |
| 16 |
contents: write |
| 17 |
concurrency: |
| 18 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 19 |
steps: |
| 20 |
- uses: actions/checkout@v4 |
| 21 |
- uses: actions/setup-python@v4 |
| 22 |
with: |
| 23 |
python-version: ${{ matrix.python-version }} |
| 24 |
- uses: actions/checkout@v3 |
| 25 |
- name: Install dependencies |
| 26 |
run: | |
| 27 |
python -m pip install --upgrade pip |
| 28 |
pip install sphinx furo sphinx-autodoc2 myst-parser |
| 29 |
- name: Build docs |
| 30 |
run: sphinx-build doc/source doc/build/html |
| 31 |
- name: Deploy Documentation |
| 32 |
if: ${{ (github.ref == 'refs/heads/main' && github.repository == 'HaoZeke/asv_bench_memray')}} |
| 33 |
uses: peaceiris/actions-gh-pages@v3 |
| 34 |
with: |
| 35 |
github_token: ${{ secrets.GITHUB_TOKEN }} |
| 36 |
publish_dir: ./doc/build/html |