-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build and deploy documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'beta' | ||
- 'release' | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- released | ||
|
||
# We need the following permission to upload the documentation as a release asset. | ||
permissions: | ||
contents: write | ||
|
||
env: | ||
WORKFLOWS_DIR: .github/workflows | ||
DOCS_DIR: docs | ||
DOCS_BUILD_DIR: docs/_build/html | ||
|
||
jobs: | ||
docs: | ||
name: Build and deploy documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 # fetches tags, required for version info | ||
- name: Set up uv | ||
# Install a specific uv version using the installer | ||
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh | ||
- name: Set up Python | ||
run: uv python install 3.12 | ||
- name: Install documentation dependencies | ||
run: | | ||
sudo apt-get install graphviz pandoc | ||
uv sync --dev | ||
- 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: uv run ./build-docs.sh | ||
# - 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: ${{ env.DOCS_BUILD_DIR }} | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# CLEAR_GLOBS_FILE: ${{ env.WORKFLOWS_DIR }}/clear-target-files | ||
# - name: Zip up documentation to store as release asset | ||
# if: ${{ github.event_name == 'release' }} | ||
# run: | | ||
# tar -cavf lambeq-docs-${{ github.event.release.tag_name }}.tar.gz -C ${{ env.DOCS_BUILD_DIR }} . | ||
# - name: Add documentation artifact as release asset | ||
# if: ${{ github.event_name == 'release' }} | ||
# run: gh release upload ${{ github.event.release.tag_name }} lambeq-docs-${{ github.event.release.tag_name }}.tar.gz --clobber | ||
# env: | ||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |