Closed MichelleBlanchette closed 8 months ago
Now that the theme is also getting built, it's taking even longer!
Hmm... I typically do one deployment each month to simply update plugins when I'm not actively working on the theme or our own plugins and the cache action states:
Caches that are not accessed within the last week will also be evicted.
So this might not be helpful in the end, even if I were to successfully implement caching... 🤨
And even when I am working on the theme more actively, I don't really do multiple deployments since my local staging environment is very accurate for testing before I even perform a deployment.
Holy cow, that took the build time from 5m 25s to just 53s when all caches hit! Booyah! I also haven't taken down production in this process, so that's neat, too. 😏🥇
Success!! 🥳
Deployments repeatedly install the same dependencies which takes quite a long time. Should be able to use GitHub Actions' caching functionality as described here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
And another simple overview described here: https://docs.github.com/en/actions/using-workflows/about-workflows#caching-dependencies
Review the durations of each job step in recent deployments to know which to optimize: https://github.com/PurpleTurtleCreative/website/actions/workflows/deploy.yml
Particularly, cache
wp-content/plugins/completionist-pro
for its commit SHA since that isn't always updated with every deployment. Sometimes I simply update the theme or update other plugins.