Skip to content

Commit

Permalink
Merge pull request #193 from rspec/add-pr-build
Browse files Browse the repository at this point in the history
Add PR build
  • Loading branch information
JonRowe authored Feb 5, 2024
2 parents 5b5be28 + 3245db7 commit 66d5e00
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build HTML content from source

on:
pull_request:
branches:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Install dependencies
run: bundle install
- name: Build with Middleman
run: |
mkdir __build
BUILD_OUTPUT="__build" middleman build
- name: Generate HTML Preview
id: html_preview
uses: pavi2410/html-preview-action@v2
with:
html_file: '__build/index.html'
- name: Access preview
run: echo "${{steps.html_preview.outputs.url}}"
2 changes: 1 addition & 1 deletion config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def configure_blog(blog)
ignored
end

set :build_dir, 'docs'
set :build_dir, ENV.fetch('BUILD_OUTPUT', 'docs')
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
Expand Down

0 comments on commit 66d5e00

Please sign in to comment.