Skip to content

Commit 71acaf1

Browse files
committed
global: pin Ruby version and update Docker and CI files
1 parent 8f58a20 commit 71acaf1

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,30 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- name: Set up Ruby
1515
uses: ruby/setup-ruby@v1
1616
with:
17-
ruby-version: 2.4.2
17+
ruby-version: '2.6.10'
1818

19-
- uses: actions/cache@v2
19+
- uses: actions/cache@v4
2020
with:
2121
path: vendor/bundle
22-
key: gems-${{ runner.os }}-2.4.2-${{ hashFiles('**/Gemfile.lock') }}
22+
key: gems-${{ runner.os }}-2.6-${{ hashFiles('**/Gemfile.lock') }}
2323
restore-keys: |
24-
gems-${{ runner.os }}-2.4.2-
24+
gems-${{ runner.os }}-2.6-
2525
gems-${{ runner.os }}-
2626
2727
- name: bundle install
2828
run: |
2929
bundle config path vendor/bundle
3030
bundle install --jobs 4 --retry 3
31+
env:
32+
BUNDLE_FORCE_RUBY_PLATFORM: true
3133
- run: bundle exec middleman build
3234

3335
- name: Deploy
34-
uses: peaceiris/actions-gh-pages@v3
36+
uses: peaceiris/actions-gh-pages@v4
3537
with:
3638
github_token: ${{ secrets.GITHUB_TOKEN }}
3739
publish_dir: ./build

.github/workflows/tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- name: Set up Ruby
1616
uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: 2.4.2
18+
ruby-version: '2.6.10'
1919

20-
- uses: actions/cache@v2
20+
- uses: actions/cache@v4
2121
with:
2222
path: vendor/bundle
23-
key: gems-${{ runner.os }}-2.4.2-${{ hashFiles('**/Gemfile.lock') }}
23+
key: gems-${{ runner.os }}-2.6-${{ hashFiles('**/Gemfile.lock') }}
2424
restore-keys: |
25-
gems-${{ runner.os }}-2.4.2-
25+
gems-${{ runner.os }}-2.6-
2626
gems-${{ runner.os }}-
2727
2828
- name: bundle install
2929
run: |
3030
bundle config path vendor/bundle
3131
bundle install --jobs 4 --retry 3
32+
env:
33+
BUNDLE_FORCE_RUBY_PLATFORM: true
3234
- run: bundle exec middleman build

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.6.10

Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
FROM ruby:2.4.2-onbuild
1+
FROM ruby:2.6.10-alpine
2+
3+
WORKDIR /usr/src/app
4+
5+
# Install system dependencies
6+
RUN apk add --no-cache nodejs npm build-base
7+
8+
# Copy application files
9+
COPY . .
10+
11+
# Install bundler and gems
12+
RUN gem install bundler:1.17.2 && \
13+
BUNDLE_FORCE_RUBY_PLATFORM=true bundle install
14+
215
VOLUME /usr/src/app/source
316
EXPOSE 4567
417

5-
RUN apt-get update && apt-get install -y nodejs \
6-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
7-
8-
CMD ["bundle", "exec", "middleman", "server", "--watcher-force-polling"]
18+
CMD ["bundle", "exec", "middleman", "server", "--bind-address=0.0.0.0", "--watcher-force-polling"]

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
source 'https://rubygems.org'
22

3+
ruby '2.6.10'
4+
35
# Middleman
46
gem 'middleman', '~>4.1.0'
57
gem 'middleman-syntax', '~> 3.0.0'

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,8 @@ DEPENDENCIES
120120
redcarpet (~> 3.3.2)
121121
rouge (~> 2.0.5)
122122

123+
RUBY VERSION
124+
ruby 2.6.10p210
125+
123126
BUNDLED WITH
124127
1.17.2

0 commit comments

Comments
 (0)