A good exercise is to look at a simple but nontrivial build/test/release automation:
- on pull requests build & test, on tags build/test and release, and once a day release a nightly build.
- cache dependencies globally and build artifacts on each branch for incremental builds
- once daily, clear out artifacts on deleted branches or merged PRs
A script to do this would be around 100 lines and be readable/maintainable (if build/test or release change, it is shared by the different cases!). The script can have a main entrypoint that will dispatch to the runners as needed.
I know it sounds a lot like jenkins, but node has a much better ecosystem than groovy.