Skip to content

Commit

Permalink
Separate bundle into earlier step.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nuclearsandwich committed Aug 13, 2024
1 parent 9daae45 commit 45cbfed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 45cbfed

Please sign in to comment.