|
1 | 1 | name: Docs
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: [main] |
6 |
| - release: |
7 |
| - types: [released] |
8 |
| - pull_request: |
9 |
| - types: [opened, synchronize] |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + release: |
| 7 | + types: [released] |
| 8 | + pull_request: |
| 9 | + types: [opened, synchronize] |
10 | 10 |
|
11 | 11 | jobs:
|
12 |
| - docs: |
13 |
| - runs-on: ubuntu-latest |
14 |
| - permissions: |
15 |
| - contents: write |
| 12 | + docs: |
| 13 | + runs-on: ubuntu-latest |
16 | 14 |
|
17 |
| - steps: |
18 |
| - - uses: actions/checkout@v3 |
| 15 | + permissions: |
| 16 | + contents: write |
19 | 17 |
|
20 |
| - - name: Setup Python |
21 |
| - uses: actions/setup-python@v4 |
22 |
| - with: |
23 |
| - python-version: "3.10" |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
24 | 20 |
|
25 |
| - - name: Install Dependencies |
26 |
| - run: | |
27 |
| - python -m pip install --upgrade pip |
28 |
| - pip install .[doc] |
| 21 | + - name: Setup Python |
| 22 | + uses: actions/setup-python@v5 |
| 23 | + with: |
| 24 | + python-version: "3.10" |
29 | 25 |
|
30 |
| - - name: Build HTML artifact |
31 |
| - run: python build_docs.py |
32 |
| - |
33 |
| - - name: Upload HTML artifact |
34 |
| - uses: actions/upload-artifact@v3 |
35 |
| - with: |
36 |
| - name: DocumentationHTML |
37 |
| - path: docs/_build/silverback |
38 |
| - |
39 |
| - - name: Commit and publish documentation changes to gh-pages branch |
40 |
| - run: | |
41 |
| - if [[ "${GITHUB_EVENT_NAME}" =~ "pull_request" ]]; then |
42 |
| - echo "skipping 'git commit' step for PR" |
43 |
| - else |
44 |
| - git clone https://github.com/${GITHUB_REPOSITORY} --branch gh-pages --single-branch gh-pages |
45 |
| - cp -r docs/_build/silverback/* gh-pages/ |
46 |
| - cd gh-pages |
47 |
| - touch .nojekyll |
48 |
| - git config --local user.email "action@github.com" |
49 |
| - git config --local user.name "GitHub Action" |
50 |
| - git add . |
51 |
| - git commit -m "Update documentation" -a || true |
52 |
| - fi |
53 |
| - - name: Push changes |
54 |
| - uses: ad-m/github-push-action@master |
55 |
| - if: ${{ github.event_name != 'pull_request' }} |
56 |
| - with: |
57 |
| - branch: gh-pages |
58 |
| - directory: gh-pages |
59 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + - name: Ape Docs |
| 27 | + uses: apeworx/sphinx-ape@main |
| 28 | + with: |
| 29 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments