Save the workflow as .github/workflows/website-regression.yml and set PRODUCTION_SITEMAP to your live sitemap. Commit Gemfile and Gemfile.lock. The Ruby setup step installs locked gems with Bundler before bundle exec jekyll build generates _site/. Set ruby-version to your production Ruby version if it differs from 3.3.
Jekyll’s baseurl affects the public paths of the generated site. For example, if production uses baseurl: "/blog", set SITE_PREFIX to /blog without the trailing slash. The workflow passes that value to Jekyll and serves _site/ at /blog/, so a production route like /blog/about/ maps to the matching local route. Keep / for an empty baseurl.
name: Jekyll regression
on: [pull_request]
permissions:
contents: read
env:
PRODUCTION_SITEMAP: https://example.com/sitemap.xml
SITE_PREFIX: /
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Build the website
run: |
bundle exec jekyll build --baseurl "${SITE_PREFIX%/}"
- name: Serve the build and check routes
env:
BUILD_DIR: _site
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
SITE_ORIGIN=http://127.0.0.1:8000
serve_dir="$BUILD_DIR"
if [[ "$SITE_PREFIX" != "/" ]]; then
serve_dir="$(mktemp -d "$RUNNER_TEMP/sireg-site.XXXXXX")"
mkdir -p "$(dirname "$serve_dir$SITE_PREFIX")"
ln -s "$PWD/$BUILD_DIR" "$serve_dir$SITE_PREFIX"
fi
python3 -m http.server 8000 --bind 127.0.0.1 --directory "$serve_dir" > "$RUNNER_TEMP/site.log" 2>&1 &
server=$!
trap 'kill "$server" 2>/dev/null || true' EXIT
curl --fail --silent --show-error --retry 10 --retry-delay 1 --retry-connrefused \
"$SITE_ORIGIN${SITE_PREFIX%/}/" > /dev/null
npx --yes sireg@1.1.0 check \
--sitemap "$PRODUCTION_SITEMAP" \
--origin "$SITE_ORIGIN" \
--strategy random --limit 25 --seed "$PR_HEAD_SHA" \
--expect-status 200 --max-redirects 0 \
--report console --html reports/sireg.html
- uses: actions/upload-artifact@v4
if: always()
with:
name: sireg-report
path: reports/sireg.html
if-no-files-found: ignore
See coverage and committed suites for full runs, artifact settings, and required checks.