Skip to content

Commit

Permalink
fix: Fix documentation build step (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab authored May 28, 2024
1 parent d481015 commit 1244e73
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Documentation

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15

concurrency:
group: ci-docs-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: retsu
auto-update-conda: true
conda-solver: libmamba
python-version: "3.8.1"

- name: Install deps
run: |
poetry config virtualenvs.create false
poetry install
# - name: Test tutorials
# run: makim --verbose tests.notebooks

- name: Generate documentation with changes from semantic-release
run: makim --verbose docs.build

- name: GitHub Pages action
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ mkdocs-macros-plugin = ">=0.7.0,<1"
mkdocs-material = ">=9.1.15"
mkdocstrings = ">=0.21.2"
mkdocstrings-python = ">=1.1.2"
mkdocs-gen-files = ">=0.5.0"
makim = "1.15.1"
# 'PosixPath' object has no attribute 'endswith'
virtualenv = "<=20.25.1"
Expand Down Expand Up @@ -110,4 +111,4 @@ ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
exclude = ["example/"]
exclude = ["example/", "scripts/"]
2 changes: 1 addition & 1 deletion scripts/gen_ref_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

for path in sorted(src.rglob("*.py")):
module_path = path.relative_to(src).with_suffix("")
doc_path = path.relative_to(src / "astx").with_suffix(".md")
doc_path = path.relative_to(src / "retsu").with_suffix(".md")
full_doc_path = Path("api", doc_path)

parts = tuple(module_path.parts)
Expand Down

0 comments on commit 1244e73

Please sign in to comment.