Skip to content

Commit 1c7e002

Browse files
(ci) Break up building and deploying of docs
1 parent 65757c4 commit 1c7e002

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,35 @@ jobs:
4242
run: |
4343
pytest plurals/tests.py
4444
45-
build-and-deploy-docs:
45+
build-docs:
4646
runs-on: ubuntu-latest
4747
needs: lint-and-test
48+
if: github.event_name == 'pull_request' || github.event_name == 'push'
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v3
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v4
56+
with:
57+
python-version: '3.9'
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install -r dev_requirements.txt
63+
pip install sphinx sphinx_rtd_theme
64+
65+
- name: Build Sphinx documentation
66+
run: |
67+
cd docs
68+
make html
69+
70+
deploy-docs:
71+
runs-on: ubuntu-latest
72+
needs: build-docs
73+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
4874

4975
steps:
5076
- name: Checkout repository
@@ -70,4 +96,4 @@ jobs:
7096
uses: peaceiris/actions-gh-pages@v3
7197
with:
7298
github_token: ${{ secrets.GITHUB_TOKEN }}
73-
publish_dir: docs/_build/html
99+
publish_dir: docs/_build/html

0 commit comments

Comments
 (0)