Skip to content

Commit 9c800b7

Browse files
Add Doc action (#2)
* update workflow yaml * update workflow to try and fix build errors * try again with action fixes * update python version in runner * update sphinx command * update sphinx command for poetry env * update sphinx command for poetry env
1 parent 46c0133 commit 9c800b7

1 file changed

Lines changed: 23 additions & 24 deletions

File tree

.github/workflows/docs_pages.yaml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
name: Docs2Pages
2-
on:
3-
push:
4-
tags: '*'
5-
pull_request:
6-
branches:
7-
- master
2+
on: [push, pull_request, workflow_dispatch]
3+
permissions:
4+
contents: write
85

96
jobs:
107
build-docs:
118
runs-on: ubuntu-latest
129
steps:
1310
- name: Checkout
14-
uses: actions/checkout@master
11+
uses: actions/checkout@v3
12+
- uses: actions/setup-python@v5
1513
with:
16-
fetch-depth: 0
17-
- uses: actions/setup-python@v2
18-
with:
19-
python-version: 3.9
20-
- uses: abatilo/actions-poetry@v2.1.3
21-
- name: install
22-
run: poetry install -E amazon -E docs
23-
- name: Build documentation
14+
python-version: '3.12'
15+
16+
- name: Install Poetry
17+
uses: snok/install-poetry@v1
18+
19+
- name: Install dependencies
2420
run: |
25-
mkdir gh-pages
26-
touch gh-pages/.nojekyll
27-
cd docs/
28-
poetry run sphinx-build -b html . _build
29-
cp -r _build/* ../gh-pages/
21+
poetry install --with dev
22+
23+
- name: Sphinx build
24+
run: |
25+
poetry run sphinx-build -M html docs/source docs/build/html
26+
3027
- name: Deploy documentation
31-
if: ${{ github.event_name == 'push' }}
32-
uses: JamesIves/github-pages-deploy-action@4.1.4
28+
uses: peaceiris/actions-gh-pages@v3
29+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
3330
with:
34-
branch: gh-pages
35-
folder: gh-pages
31+
publish_branch: gh-pages
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./docs/build/html
34+
force_orphan: true

0 commit comments

Comments
 (0)