Skip to content

infra: Add upload-artifact step when building docs #227

infra: Add upload-artifact step when building docs

infra: Add upload-artifact step when building docs #227

Workflow file for this run

name: Build and deploy documentation
on:
push:
branches:
- 'main'
- 'beta'
- 'release'
pull_request:
env:
WORKFLOWS_DIR: .github/workflows
DOCS_DIR: docs
jobs:
docs:
name: Build and deploy documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetches tags, required for version info
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Build lambeq
run: pip install .
- name: Install documentation dependencies
run: |
sudo apt-get install graphviz pandoc
pip install -r docs/requirements.txt
- name: Draw diagrams from PlantUML files
uses: Timmy/plantuml-action@v1
with:
args: '-v -DPLANTUML_LIMIT_SIZE=8192 -tpng ${{ env.DOCS_DIR }}/puml/*.puml -o img'
- name: Build documentation
run: ${{ env.WORKFLOWS_DIR }}/build-docs
- name: Save documentation as artifact
uses: actions/upload-artifact@v4
with:
name: docs_html
path: docs/_build/html
- name: Deploy documentation
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'release') }}
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: docs
FOLDER: docs/_build/html/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLEAR_GLOBS_FILE: ${{ env.WORKFLOWS_DIR }}/clear-target-files