refactor: update to tylisten v1 #86
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: Sphinx Build and Deploy | |
on: | |
pull_request: | |
types: | |
- review_requested | |
branches: | |
- beta | |
- "beta/**" | |
push: | |
branches: | |
- beta | |
- "beta/**" | |
paths: | |
- doc/** | |
- .github/workflows/sphinx.yml | |
concurrency: | |
group: pages | |
cancel-in-progress: true | |
jobs: | |
sphinx-build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/configure-pages@v3 | |
- run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: poetry | |
- name: Install Library and Build HTML | |
run: | | |
echo "::group::Install Library" | |
poetry install --with docs --without test | |
echo "::endgroup::" | |
echo "::group::Build HTML" | |
poetry run sphinx-build doc/source doc/build/html -D release=$(poetry version -s) | |
echo "::endgroup::" | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "doc/build/html" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload artifact | |
if: github.event_name == 'push' | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: doc/build/html | |
deploy: | |
if: github.event_name == 'push' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: sphinx-build | |
outputs: | |
page_url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |