Skip to content

Commit 66d5e00

Browse files
authored
Merge pull request #193 from rspec/add-pr-build
Add PR build
2 parents 5b5be28 + 3245db7 commit 66d5e00

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

Diff for: .github/workflows/build.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build HTML content from source
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: false
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Setup Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: '3.3'
25+
- name: Install dependencies
26+
run: bundle install
27+
- name: Build with Middleman
28+
run: |
29+
mkdir __build
30+
BUILD_OUTPUT="__build" middleman build
31+
- name: Generate HTML Preview
32+
id: html_preview
33+
uses: pavi2410/html-preview-action@v2
34+
with:
35+
html_file: '__build/index.html'
36+
- name: Access preview
37+
run: echo "${{steps.html_preview.outputs.url}}"

Diff for: config.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def configure_blog(blog)
7474
ignored
7575
end
7676

77-
set :build_dir, 'docs'
77+
set :build_dir, ENV.fetch('BUILD_OUTPUT', 'docs')
7878
set :css_dir, 'stylesheets'
7979
set :js_dir, 'javascripts'
8080
set :images_dir, 'images'

0 commit comments

Comments
 (0)