0

NxCloud offers caching and storing the build artifacts (of fine-grained libraries) in their cloud, so both CI and developers in their local machines can reuse the the build artifacts.

But NxCloud is paid. And I wonder if it's possible to use pure Nx tool but leverage the plain cache storage of the Github Actions instead, so at least the CI can reuse the build artifacts across PRs? (I'm aware and accept in that case the cache wouldn't be reused by developers in their local machines.)

Krzysztof Platis
  • 1,183
  • 5
  • 14

1 Answers1

1

I guess you could do something like that if you wanted to use the cache functionality of Github as storage. Your storage would be limited but if should be big enough for smaller projects.

Just use the same key for retrieving the hash and store it some place on the action-runner. Then use NX_CACHE_DIRECTORY env variable to direct nx to use the GitHub cache directory and voila.

A problem will occur when you have concurrent builds as some of your build caches will get lost.

Jonoje
  • 11
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 23 '22 at 18:26