Skip to content

Commit 7289973

Browse files
authoredFeb 5, 2024
Merge pull request #194 from rspec/cache-build
Setup cache
2 parents 77a043d + 50e8771 commit 7289973

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed
 

Diff for: ‎.github/workflows/build.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,28 @@ jobs:
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v4
21+
- name: Setup bundler cache
22+
uses: actions/cache@v3
23+
with:
24+
key: ${{ runner.os }}-bundler-${{ hashFiles('Gemfile.lock') }}
25+
path: .bundle/gems
26+
- name: Setup build cache
27+
uses: actions/cache@v3
28+
with:
29+
key: ${{ runner.os }}-build
30+
path: __build
2131
- name: Setup Ruby
2232
uses: ruby/setup-ruby@v1
2333
with:
2434
ruby-version: '3.3'
2535
- name: Install dependencies
26-
run: bundle install
36+
run: |
37+
bundle config set --local path '.bundle/gems'
38+
bundle install
2739
- name: Build with Middleman
2840
run: |
29-
mkdir __build
30-
BUILD_OUTPUT="__build" middleman build
41+
mkdir -p __build
42+
BUILD_OUTPUT="__build" bundle exec middleman build
3143
- name: Generate HTML Preview
3244
id: html_preview
3345
uses: pavi2410/html-preview-action@v2

Diff for: ‎.github/workflows/middleman_deploy.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,21 @@ jobs:
3737
uses: ruby/setup-ruby@v1
3838
with:
3939
ruby-version: '3.3'
40+
- name: Setup bundler cache
41+
uses: actions/cache@v3
42+
with:
43+
key: ${{ runner.os }}-bundler-${{ hashFiles('Gemfile.lock') }}
44+
path: .bundle/gems
45+
- name: Setup build cache
46+
uses: actions/cache@v3
47+
with:
48+
key: ${{ runner.os }}-source-build
49+
path: __source_build
4050
- name: Install dependencies
4151
run: bundle install
4252
- name: Build with Middleman
4353
run: |
44-
mkdir __source_build
54+
mkdir -p __source_build
4555
BUILD_OUTPUT="__source_build" middleman build
4656
- name: Set CNAME
4757
run: echo "rspec.info" > CNAME

0 commit comments

Comments
 (0)
Please sign in to comment.