Skip to content

PR Preview

PR Preview #438

Workflow file for this run

# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: preview-deploy
on:
pull_request_target:
branches: [ "master" ]
types: [opened, synchronize, reopened]
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
concurrency:
group: "pages-${{ github.event.pull_request.number || github.run_id }}"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-24.04
env:
HUGO_VERSION: 0.152.2
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Deployment job
deploy:
runs-on: ubuntu-24.04
needs: build
steps:
- name: Deploy PR Preview
uses: rossjrw/pr-preview-action@v1.6.3
with:
source-dir: ./public
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto