DOC: switch to source code and edit buttons #216
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: Documentation | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
doc: | |
if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main') || github.event_name == 'pull_request' | |
name: Execute and build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- run: pip install -e .[doc] tox -c .constraints/py3.10.txt | |
- name: Fetch Jupyter cache | |
uses: actions/cache@v3 | |
with: | |
key: jupyter-cache-${{ hashFiles('docs/**.ipynb') }} | |
restore-keys: | | |
jupyter-cache-${{ hashFiles('docs/**.ipynb') }} | |
jupyter-cache | |
path: | | |
./docs/_build/.jupyter_cache | |
- name: Fetch downloaded data | |
uses: actions/cache@v3 | |
with: | |
key: data-${{ hashFiles('docs/**.ipynb') }} | |
restore-keys: | | |
data-${{ hashFiles('docs/**.ipynb') }} | |
data | |
path: | | |
./docs/data | |
- run: tox -e docnb | |
- uses: actions/upload-pages-artifact@v2 | |
if: always() | |
with: | |
path: ./docs/_build/html | |
gh-pages: | |
if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main') | |
name: Upload to GitHub Pages | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: | |
- doc | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-22.04 | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v2 |