Skip to content

📝 Create makefile to automate docs building process (#165) #524

📝 Create makefile to automate docs building process (#165)

📝 Create makefile to automate docs building process (#165) #524

Workflow file for this run

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
changelog:
name: Update changelog
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Update CHANGELOG.md
uses: rhysd/changelog-from-release/action@v3
with:
file: CHANGELOG.md
github_token: ${{ secrets.GITHUB_TOKEN }}
header: |
# Release Notes
All notable changes to this project are documented in this file. It was automatically generated with
the [changelog-from-release](https://github.com/rhysd/changelog-from-release) tool.