Skip to content

Commit

Permalink
Use $URL not $DEPLOY_PRIME_URL for prod deploys
Browse files Browse the repository at this point in the history
$DEPLOY_PRIME_URL appears to point at a .netlify.app version of the
site, rather than the URL it's actually getting deployed as for prod
deploys. But is needed for preview deploys.
  • Loading branch information
illicitonion committed Dec 27, 2024
1 parent 9d1ccc8 commit 39ba212
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tooling/common-config/deploy-netlify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ set -euo pipefail

npm install --legacy-peer-deps

URL_TO_USE="${URL}"
if [[ "${PULL_REQUEST}" == "true" ]]; then
URL_TO_USE="${DEPLOY_PRIME_URL}"
fi

# We set --baseURL on netlify so that any references to .Permalink end up pointing at deploy preview pages, rather than being hard-coded to point at the production URLs.
hugo --minify --environment production --baseURL $DEPLOY_PRIME_URL && npx pagefind --site "public"
hugo --minify --environment production --baseURL "${URL_TO_USE}" && npx pagefind --site "public"

0 comments on commit 39ba212

Please sign in to comment.