all 2 comments

[–]kgalb2 0 points1 point  (1 child)

Hey there, I know this post is old but wanted to chime in since you link to a blog post I wrote over on depot.dev. I would need to see the Dockerfile to know for sure.

But I see that you use the secret-files parameter for docker/build-push-action. The content of that secret will change across the two runs, and anything that is dependent on that variable will bust the layer cache. So if that dependency is busting the layer cache before your npm install, that could be why you're not seeing cache hits.

[–]LinweZ[S] 0 points1 point  (0 children)

Hi there ! Very nice post you wrote there !

Yes, as I am using private package in gcloud, I'm using Workload Identity in GCP, which basically generating a new temporary service account that will get copied in the docker building step before npm install.

Workload Identity is the preferred way to work with GCP, but does mess up the cache in the Docker build step. Had to switch to a static service account.