Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ANazaret committed Nov 4, 2024
1 parent 29ed527 commit c9d2976
Showing 1 changed file with 44 additions and 21 deletions.
65 changes: 44 additions & 21 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
name: documentation
name: Documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write
on:
push:
branches: [ site ]
pull_request:
branches: [ site ]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install sphinx myst-parser nbsphinx furo
- name: Sphinx build
run: |
sphinx-build docs/docs/source _build
- 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: _build/
force_orphan: true
- uses: actions/checkout@v3
with:
ref: site

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

- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs]
pip install sphinx nbsphinx myst-parser furo
- name: Install package in editable mode
run: |
pip install -e .
- name: Build documentation
run: |
cd docs/docs
sphinx-build -b html source _build/html
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/site'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/docs/_build/html
publish_branch: gh-pages
force_orphan: true
commit_message: "Deploy documentation updates"

0 comments on commit c9d2976

Please sign in to comment.