Skip to content

Commit

Permalink
Fix Docker issues
Browse files Browse the repository at this point in the history
- Copy `.ruby-version` file to Docker build context
- always run `docker build` in CI, even when not deploying
  • Loading branch information
MikeMcQuaid committed May 23, 2024
1 parent 70e2e6e commit 7e1bb73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**/.*
.dockerignore
.editorconfig
.github/
.gitignore
.rubocop.yml
deployment/
state.json
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- name: Run RuboCop
run: bundle exec rubocop

- name: Build Docker image
run: docker build --build-arg RUBY_VERSION=$(cat .ruby-version) .

deploy:
needs: checks
if: github.repository_owner == 'Homebrew' && github.event_name == 'push'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM ruby:$RUBY_VERSION-alpine
RUN apk add --no-cache --virtual .build-deps git build-base

WORKDIR /app
COPY Gemfile* ./
COPY .ruby-version Gemfile* ./
ENV BUNDLE_DEPLOYMENT=1
RUN bundle install && apk del --no-cache .build-deps

Expand Down

0 comments on commit 7e1bb73

Please sign in to comment.