Skip to content

Commit

Permalink
fix env vars in netlify config
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies committed Jun 20, 2023
1 parent be923be commit 7452a17
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish = "public/"
# On netlify our branch will always be the one we are currently building for
# important information regarding naming
# https://gohugo.io/getting-started/configuration/#configure-with-environment-variables
command = "HUGOxPARAMSxGITHUB_BRANCH=$BRANCH hugo -b $DEPLOY_PRIME_URL"
command = "HUGOxPARAMSxCURRENTVERSION=$BRANCH HUGOxPARAMSxGITHUB_BRANCH=$BRANCH hugo -b $DEPLOY_PRIME_URL"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../netlify.toml"

[build.environment]
Expand All @@ -14,13 +14,7 @@ ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../netlify.toml"
HUGO_VERSION = "0.111.3"
HUGO_ENABLEGITINFO = "true"

# On netlify our branch will always be the one we are currently building for
# important information regarding naming
# https://gohugo.io/getting-started/configuration/#configure-with-environment-variables
HUGOxPARAMSxGITHUB_BRANCH="$BRANCH"
HUGOxPARAMSxCURRENTVERSION="$BRANCH"

[context.deploy-preview]
[context.deploy-preview.environment]
HUGO_ENV = "development"

[context.branch-deploy.environment]
Expand All @@ -33,4 +27,4 @@ HUGO_ENV = "production"
# On netlify our branch will always be the one we are currently building for
# important information regarding naming
# https://gohugo.io/getting-started/configuration/#configure-with-environment-variables
command = "HUGOxPARAMSxGITHUB_BRANCH=$BRANCH hugo -b $URL"
command = "HUGOxPARAMSxCURRENTVERSION=$BRANCH HUGOxPARAMSxGITHUB_BRANCH=$BRANCH hugo -b $URL"

0 comments on commit 7452a17

Please sign in to comment.