Skip to content

Commit 08c488f

Browse files
authored
Use $URL not $DEPLOY_PRIME_URL for prod deploys (#1265)
$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.
1 parent 6cc635f commit 08c488f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tooling/common-config/deploy-netlify.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ set -euo pipefail
44

55
npm install --legacy-peer-deps
66

7+
URL_TO_USE="${URL}"
8+
if [[ "${PULL_REQUEST}" == "true" ]]; then
9+
URL_TO_USE="${DEPLOY_PRIME_URL}"
10+
fi
11+
712
# 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.
8-
hugo --minify --environment production --baseURL $DEPLOY_PRIME_URL && npx pagefind --site "public"
13+
hugo --minify --environment production --baseURL "${URL_TO_USE}" && npx pagefind --site "public"

0 commit comments

Comments
 (0)