4 ms·
I've seen something like this being used to show the last X commits in a readme and I hate to be _that_ guy, but do we really need scripts that spin up a VM and
by nikeee 4y ago
I've seen something like this being used to show the last X commits in a readme and I hate to be _that_ guy, but do we really need scripts that spin up a VM and install python/ruby/whatever multiple times a day just to potentially update a readme that only a few people will see?
Doing this once a week, like the article mentions, should be good enough for most people. It's not _that_ critical information.
- hk1337 4y agoI would even have both repositories on GitHub and see about triggering a workflow in my username repository to run, so it only runs when it needs to. EDIT https://blog.marcnuri.com/triggering-github-actions-across-different-repositories https://blog.marcnuri.com/triggering-github-actions-across-d... Or you use something like this, build your blog in CI, get the top X posts in its CI workflow, and send it as JSON payload to the GitHub repository with the README you want to upload.
- simonw 4y agoI do think it's good practice to enable caching, such that your script doesn't hit RubyGems / pip / npm / etc every time it runs. That way at least the automation activity stays entirely within the GitHub / Azure network. It looks like you can do that for Ruby by adding this: https://github.com/actions/cache/blob/master/examples.md#ruby---bundler https://github.com/actions/cache/blob/master/examples.md#rub... - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 bundler-cache: true
- beebmam 4y agoI'd guess a single search on Google probably consumes more J than this
- nl 4y agoIn 2011 a search on Google cost roughly 0.0003 kWh[1] (Although I suspect it is more energy efficient now). According to [2], a small VM uses around 7.5 Wh for 30 minutes (for a blended load of active/idle if I understand it correctly), or 0.00023 kWh per minute. So in very rough numbers with a lot of assumptions if your process takes less than 1:30 to install and run your program you are probably comparable to a Google search. More than that and you are almost certainly less energy efficient. [1] https://www.nytimes.com/2011/09/09/technology/google-details-and-defends-its-use-of-electricity.html https://www.nytimes.com/2011/09/09/technology/google-details... [2] https://www.researchgate.net/figure/Mean-Energy-Consumption-per-VM-for-30-minutes_fig10_328832118 https://www.researchgate.net/figure/Mean-Energy-Consumption-...
- nine_k 4y agoIf you want it to be very efficient, pick a language like Rust, Go, Nim, maybe even Crystal or Haskell, which can produce a (mostly) self-contained executable, without installing anything. Write the logic for updating your profile with it, all while honing your efficient coding skills. The few people who look at your GitHub profile may be some important people, like your every future prospective employer. It may make sense to impress them a little bit.
- craigmcnamara 4y agoRuby pays the bills and is nice to work with.
- ethicalsmacker 4y agoinsert cocaine joke
- nine_k 4y agoI think Ruby is fine for the task. But if anybody wanted to show off the ability to run these updates excessively quickly and economically, there is a number of ways.