Skip to content

Commit

Permalink
Rebuild all documentation from scratch when there is a new release (#396
Browse files Browse the repository at this point in the history
)

* Comment if statements so documentation is built for all versions

* Documentation is rebuilt from scratch when there is a release now
  • Loading branch information
tomicapretto authored Aug 18, 2021
1 parent 48f5ffc commit c8a8cc9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 23 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish-docs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Rebuilt entire documentation

on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: r-lib/actions/setup-pandoc@v1
- name: Checkout Source
uses: actions/checkout@v2
with:
# require all of history to see all tagged versions' docs
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
python setup.py build
python setup.py install
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: docs/_build/html

- name: Remove and build documentation from scratch
run: |
rm -rd docs/_build/html
sphinx-multiversion docs docs/_build/html
touch docs/_build/html/.nojekyll
cp docs/_assets/gh-pages-redirect.html docs/_build/html/index.html
- name: Publish Docs to gh-pages
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
keep_files: true
4 changes: 2 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Buld and publish documentation
name: Build and publish documentation

on:
push:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.7"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Run tests

on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
python-version: ["3.7", "3.8", "3.9"]

name: Set up Python ${{ matrix.python-version }}
steps:
Expand Down

0 comments on commit c8a8cc9

Please sign in to comment.