From 45cbfed5349fb6e93a338ec95623922c606d4931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnar=C3=B6k?= Date: Thu, 8 Aug 2024 18:54:02 -0700 Subject: [PATCH] Separate bundle into earlier step. Copying just the bundler configurations and running bundle install in the earlier step dramatically cuts down on iteration time since the bundle install will only re-run if the gems actually change. --- Earthfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Earthfile b/Earthfile index 17aa227..bd879ad 100644 --- a/Earthfile +++ b/Earthfile @@ -1,16 +1,21 @@ VERSION 0.8 +bundle: + FROM docker.io/library/ruby:3.3 + COPY --dir Gemfile Gemfile.lock \ + /src/site + WORKDIR /src/site + RUN bundle install + nanoc: #FROM docker.io/library/ruby:3.3-alpine - FROM docker.io/library/ruby:3.3 + FROM +bundle COPY --dir content layouts lib Gemfile Gemfile.lock Rules nanoc.yaml \ /src/site/ - WORKDIR /src/site build: FROM +nanoc - RUN bundle install RUN bundle exec nanoc SAVE ARTIFACT output AS LOCAL output