Skip to content

Commit d60d3c8

Browse files
authored
ci(doc): add doc build caching
1 parent da952fa commit d60d3c8

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/docs.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,36 @@ jobs:
117117
run: |
118118
choco install pandoc
119119
120+
- name: "Restore doc build cache"
121+
id: cache-doc-build-restore
122+
uses: actions/cache/restore@v4
123+
with:
124+
path: |
125+
doc/build
126+
key: doc-build-${{ github.ref_name }}
127+
restore-keys: |
128+
doc-build-master
129+
120130
- name: "Build HTML Documentation"
121131
shell: bash
122132
run: |
123133
tox -e doc-html --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true'
124134
125-
- name: "Retrieve package version"
126-
shell: bash
127-
run: |
128-
echo "VERSION=$(python -c "from ansys.dpf.${{env.MODULE}} import __version__; print(__version__)")" >> GITHUB_OUTPUT
129-
echo "${{env.PACKAGE_NAME}} version is: $(python -c "from ansys.dpf.${{env.MODULE}} import __version__; print(__version__)")"
130-
id: version
131-
if: always()
132-
133135
- name: "Upload Documentation Build log"
134136
uses: actions/upload-artifact@v4
135137
with:
136138
name: doc-${{env.PACKAGE_NAME}}-log
137139
path: doc/*.txt
138140
if: always()
139141

142+
- name: "Save doc-build cache"
143+
id: cache-doc-build-save
144+
uses: actions/cache/save@v4
145+
with:
146+
path: |
147+
doc/build
148+
key: ${{ steps.cache-doc-build-restore.outputs.cache-primary-key }}
149+
140150
- name: "Zip HTML Documentation"
141151
shell: pwsh
142152
run: |

0 commit comments

Comments
 (0)