Streamlit and quarto relative paths, and fix plots resizing #372
Workflow file for this run
This file contains hidden or 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: Docs and Report Examples | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
jobs: | |
test: | |
name: Test docs and report examples | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" # caching pip dependencies | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[docs] | |
- name: Build references | |
run: | | |
cd docs | |
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen | |
- name: Build documentation | |
run: | | |
cd docs | |
sphinx-build -n --keep-going -b html ./ ./_build/ | |
# --- HTML example deployment --- | |
- name: Rename entry point of report to index.html | |
run: | | |
mv docs/quarto_report/quarto_report.html docs/quarto_report/index.html | |
- name: Publish HTML report to GitHub Pages (gh-pages branch) | |
# Only publish a new static report upon a new release -> can be changed. | |
if: startsWith(github.ref, 'refs/tags') | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/quarto_report/ | |
# - name: save artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: Sphinx_${{ matrix.python-version }} | |
# path: docs/_build/ | |
# --- Streamlit example deployment --- | |
#- name: Fix Absolute Paths in Streamlit Scripts | |
# run: | | |
# find docs/streamlit_report/sections -type f -name "*.py" -exec sed -i 's|/home/runner/work/vuegen/vuegen/docs/||g' {} + | |
- name: Publish Streamlit report to streamlit-example branch | |
if: startsWith(github.ref, 'refs/tags') | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/ | |
publish_branch: streamlit-report-example |