youyo/aws-cdk-github-actions

Skip CDK and TypeScript installations if they are already installed

Opened this issue · 1 comments

While looking at ways to optimize the GitHub actions usage (build minutes, billing) for our projects, I noticed that using the CDK GitHub action was always taking a significant amount of time, compared to running our own "cdk synth" or "cdk deploy" commands without this action.

Looking deeper, I noticed that this action is ALWAYS installing typescript and the CDK CLI, regardless if they are already installed inside the project through other means (e.g. a global install step that precedes all other steps, including CDK deployment; which is what we have today - a single dependency installation step that prepares the ground for all subsequent build, test, deploy stages).

So my suggestion is to replace the existing commands for installing the TypeScript and CDK tooling with alternatives that only install them conditionally, e.g:

typescript version || npm install typescript

cdk --version || npm install aws-cdk

I might be able to contribute with such improvements, but wanted to see what the maintainer and consumers of this action think about the idea.

I like this idea, especially with multiple stacks to deploy. Would love to reference a matrix list of stacks and just have the deploy command loop over them with a single idk instantiation.