File size: 1,249 Bytes
e072ef3
 
 
 
 
 
 
 
 
 
 
ae96818
61ab7a6
e072ef3
 
 
2a3f899
e072ef3
 
 
 
 
 
 
 
 
bd436f3
e072ef3
 
 
 
aed2b32
 
 
 
e072ef3
 
96f8639
e072ef3
 
 
9ddc851
e072ef3
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: docs

on:
  push:
    branches:
      - 'master'
    paths:
      - 'pysr/**'
      - '.github/workflows/docs.yml'
      - 'docs/**'
      - 'setup.py'
      - 'README.md'
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    
    steps:
      - uses: actions/checkout@v2
      - name: "Set up Python"
        uses: actions/setup-python@v1
        with:
          python-version: 3.9
      - name: "Set up npm"
        uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: "Install packages for docs building"
        run: |
          npm install -g docsify
          pip install pydoc-markdown==4.5.0 pyyaml
      - name: "Build API docs"
        run: |
          cat README.md | grep -v 'pysr_logo.svg' > docs/README.md
          pydoc-markdown --build --site-dir build -vv
          cp docs/build/content/docs/api*.md docs/
          for f in docs/api*.md; do mv "$f" "$f.bkup" && cat "$f.bkup" | sed '1,4d' > "$f" && rm "$f.bkup"; done
          cd docs && python generate_papers.py && cd ..
      - name: "Deploy documentation"
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: docs