Skip to content

Commit

Permalink
Cache content when building the documentation. (#1882)
Browse files Browse the repository at this point in the history
* Add the cache for the documentation.

* Rename ci-build to build_documentation.

* Fix the version.
  • Loading branch information
MaxJPRey committed Nov 15, 2022
1 parent 1433388 commit 21f0c7e
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ name: Documentation Build

on: [pull_request, workflow_dispatch]

env:
# Following env vars when changed will "reset" the mentioned cache,
# by changing the cache file name. It is rendered as ...-v%RESET_XXX%-...
# You should go up in number, if you go down (or repeat a previous value)
# you might end up reusing a previous cache if it haven't been deleted already.
# It applies 7 days retention policy by default.
RESET_EXAMPLES_CACHE: 3
RESET_DOC_BUILD_CACHE: 3
RESET_AUTOSUMMARY_CACHE: 3


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -43,6 +54,27 @@ jobs:
- name: Verify pyaedt can be imported
run: python -c "import pyaedt"

- name: Retrieve PyAEDT version
id: version
run: |
echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
- name: Cache docs build directory
uses: actions/cache@v3
with:
path: doc/build
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}
- name: Cache autosummary
uses: actions/cache@v3
with:
path: doc/source/**/_autosummary/*.rst
key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }}
restore-keys: |
autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}
- name: Install doc build requirements
run: |
pip install -r requirements_docs.txt
Expand Down

0 comments on commit 21f0c7e

Please sign in to comment.