Closed practicalli-johnny closed 1 year ago
.github/workflows/publish-website.yaml
configuration updated and pushed to see if cache is created.
Cache is working on the initial run
Cache is not finding the path, so an update is required
In the GitHub actions the setting up of Gitbook and building the book takes nearly 6 minutes without a cache
info: >> generation finished with success in 336.7s !
Setting the path using npm looks promising
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
Cache is being restored successfully in subsequent runs of the Gitbook Publish workflow
The cache does save around 1 minute in build time. However, it seems most of the build time is due to installing Gitbook and its very many modules.
Further improvements in deployment time may come from creating a Docker image with Gitbook already installed along with all the plugins needed. This could then be cached by docker itself and would speed up builds.
TODO: Create separate issue to develop a Gitbook Docker image with relevant plugins pre-installed and use that as the basis of the Gitbook Publisher action
Add a simple cache action configuration to the
.github/workflows/publish-website.yaml
workflowReference: https://github.com/actions/cache/blob/main/examples.md#node---npm
Test that the Gitbook plugins and other node_modules are being cached on successive builds