Skip to content
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ jobs:
npm run build -- --mode preview --base "$base"

# Recorded so the publish job can refuse a build made for the wrong
# path, instead of publishing a page that loads nothing.
printf '%s' "$base" > dist/.preview-base
# path, instead of publishing a page that loads nothing. Not a
# dotfile: actions/upload-artifact leaves hidden files out of the
# artifact by default, and this has to survive the trip.
printf '%s' "$base" > dist/preview-base

# A CNAME means something only at the site root, and the root belongs
# to the production deploy.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ jobs:
# blank, which is worth an error rather than a puzzled contributor.
# Stripped of anything but path characters before being echoed, since
# the file came from the build.
built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/.preview-base 2>/dev/null || true)"
built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/preview-base 2>/dev/null || true)"
if [ "$built_base" != "$EXPECTED_BASE" ]; then
echo "::error::this build is for '${built_base:-<unset>}' but the site serves '${EXPECTED_BASE}'."
echo "::error::set PREVIEW_PUBLIC_BASE=${{ needs.resolve.outputs.base_path }} in frontend/.env.preview"
exit 1
fi
rm -f preview/.preview-base
rm -f preview/preview-base

- name: Publish to gh-pages
env:
Expand Down
Loading