Nrwl/Nx: Is it possible to store libraries' build artifacts in the storage of Github Actions instead of NxCloud?

1.3k views Asked by At

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.)

1

There are 1 answers

1
Jonoje On

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.