Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/build-docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
build-docs-preview:
runs-on: ubuntu-24.04
if: github.event.action != 'closed'
# env:
# HUGO_VERSION: 0.158.0

steps:
# Hugo Module fetching hits proxy.golang.org and sum.golang.org. Harmless under egress-policy: audit, but if the harden-runner is promoted to block,
Expand All @@ -40,33 +38,6 @@ jobs:
with:
persist-credentials: false

# hugo-extended is one of the dependencies which gets added onto the node_modules whenever npm install is run,
# so the commented out code below serves as a second installation of hugo within the runner.
# the commented out code is to be removed if the pr preview builds successfully.

# - 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
# # Direct download from the dart-sass GitHub release rather than
# # `sudo snap install dart-sass` (snap.io's storeserver was flaky
# # in GitHub-hosted runners and broke this workflow on unrelated
# # PRs, see #19574). Hugo Extended ships embedded Dart Sass as of
# # v0.114+ but having the standalone binary on PATH is the most
# # reliable path through `resources.toCSS` with transpiler "dartsass".
# env:
# DART_SASS_VERSION: 1.79.5
# run: |
# set -eu
# cd "${RUNNER_TEMP}"
# curl -fsSL -o dart-sass.tar.gz "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
# sudo tar -xzf dart-sass.tar.gz -C /usr/local/lib
# sudo ln -sf /usr/local/lib/dart-sass/sass /usr/local/bin/sass
# sudo ln -sf /usr/local/lib/dart-sass/sass /usr/local/bin/dart-sass
# dart-sass --version

- name: Setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/deploy-docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
egress-policy: audit

- name: Download build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: docs-preview-build
path: docs-preview-build
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
persist-credentials: true

- name: Download build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: docs-preview-build
path: docs-preview-build
Expand All @@ -85,18 +85,33 @@ jobs:
umbrella-dir: pr-preview # must match the /pr-preview/ baseURL the build bakes
qr-code: false
comment: false
wait-for-pages-deployment: false
action: ${{ needs.read-metadata.outputs.action == 'closed' && 'remove' || 'deploy' }}
pr-number: ${{ needs.read-metadata.outputs.pr-number }}

- name: Build preview comment
if: needs.read-metadata.outputs.action != 'closed'
id: comment-body
env:
PREVIEW_URL: ${{ steps.preview.outputs.preview-url }}
REPO: ${{ github.repository }}
run: |
{
echo "body<<EOF"
echo "🚀 Preview deployment: ${PREVIEW_URL}"
echo "> *Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment [here](https://github.com/${REPO}/actions/workflows/pages/pages-build-deployment)*"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Comment preview URL
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5
with:
header: pr-preview
number: ${{ needs.read-metadata.outputs.pr-number }}
message: |
${{ needs.read-metadata.outputs.action == 'closed'
&& 'Preview removed because the pull request was closed.'
|| format('📖 Pull request preview: {0}', steps.preview.outputs.preview-url) }}
|| steps.comment-body.outputs.body }}

prune:
needs: read-metadata
Expand All @@ -107,7 +122,7 @@ jobs:
removed_prs_json: ${{ steps.prune-previews.outputs.removed_prs_json }}
steps:
- name: Checkout gh-pages for preview retention
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: gh-pages
fetch-depth: 0
Expand Down Expand Up @@ -201,7 +216,7 @@ jobs:
fi

- name: Comment on pruned previews
uses: actions/github-script@v8
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
REMOVED_PRS_JSON: ${{ steps.prune-previews.outputs.removed_prs_json }}
PREVIEW_RETENTION_LIMIT: ${{ env.PREVIEW_RETENTION_LIMIT }}
Expand Down Expand Up @@ -247,4 +262,4 @@ jobs:
issue_number: Number(prNumber),
body,
});
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Exam 1"
title: "Exam 1 (Preview Test)"
weight: 1
passPercentage: 70
questions:
Expand All @@ -17,4 +17,7 @@ questions:
isCorrect: true
layout: "test"
type: "test"
---
---
<!-- preview workflow test: 2026-08-07T02:05:18Z -->

<!-- preview workflow test v2: 2026-08-07T02:21:55Z -->
Loading