diff --git a/.dockerignore b/.dockerignore index 0fd8fbd..5e64996 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,7 @@ -**/.* +.dockerignore +.editorconfig +.github/ +.gitignore +.rubocop.yml deployment/ state.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f40dff..ff08ffc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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' diff --git a/Dockerfile b/Dockerfile index b7e7698..4bdc7cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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