Various format improvements, wider Python support, dependency cleanup #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends pandoc | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install '.[all]' | |
- name: Generate the documentation | |
run: | | |
cd docs/ | |
make html | |
- name: Deploy if 'main' branch | |
uses: peaceiris/actions-gh-pages@v4 | |
# Only publish if we are on main! | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html/ | |
- name: Deploy if PR | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref != 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html/ | |
destination_dir: ./pull/${{github.event.number}}/ | |
- name: Add comment if PR | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
header: documentation-preview | |
recreate: true | |
message: | | |
A preview of ${{ github.event.after }} is uploaded and can be seen here: | |
✨ https://tqec.github.io/tqecd/pull/${{github.event.number}}/ ✨ | |
Changes may take a few minutes to propagate. |