Skip to content

Add GitHub action to build the site on PR #5

Add GitHub action to build the site on PR

Add GitHub action to build the site on PR #5

Workflow file for this run

name: HTML preview
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Build the site
run: bundle exec jekyll build
- name: Upload the site as artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: preview
path: _site/
retention-days: 7
- name: Print preview instructions
run: |
echo ""
echo "Download the preview artifact from:"
echo " https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo ""
echo "Then extract and serve locally:"
echo " unzip -o ~/Downloads/preview.zip -d /tmp/site-preview && (sleep 1 && python3 -m webbrowser http://localhost:8000) & python3 -m http.server -d /tmp/site-preview 8000"
echo ""