diff --git a/netlify.toml b/netlify.toml index 197f3f56e2..78888c360f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -10,22 +10,22 @@ [dev] # local development with the Netlify CLI - command = "make serve" + command = "bash ./scripts/local-server.sh" targetPort = 1313 port = 8000 [context.production] - command = "make bundle; hugo --gc --minify --enableGitInfo" + command = "bash ./scripts/netlify-deploy-production.sh" [context.production.environment] HUGO_ENV = "production" [context.deploy-preview] - command = "make bundle; hugo --gc --minify --enableGitInfo --buildFuture" + command = "bash ./scripts/netlify-deploy-preview.sh" [context.deploy-preview.environment] HUGO_ENV = "staging" [context.branch-deploy] - command = "make bundle; hugo --gc --minify --enableGitInfo" + command = "bash ./scripts/netlify-branch-deploy.sh" [context.branch-deploy.environment] HUGO_ENV = "branch-deploy" diff --git a/scripts/local-server.sh b/scripts/local-server.sh new file mode 100644 index 0000000000..df899314f8 --- /dev/null +++ b/scripts/local-server.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eou pipefail + +### +# Local deploy preview using Netlify CLI +# https://docs.netlify.com/cli/get-started/ +# Run 'netlify dev' +### + +pushd themes/docs-new && npm install && popd +hugo server -b localhost:1313 diff --git a/scripts/netlify-branch-deploy.sh b/scripts/netlify-branch-deploy.sh new file mode 100644 index 0000000000..968463391d --- /dev/null +++ b/scripts/netlify-branch-deploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify branch builds +# https://docs.netlify.com/site-deploys/overview/#branches-and-deploys +### + +echo Branch: $HEAD +echo Branch deploy URL: $DEPLOY_PRIME_URL + +pushd themes/docs-new && npm install && popd +hugo --gc --minify --enableGitInfo diff --git a/scripts/netlify-deploy-preview.sh b/scripts/netlify-deploy-preview.sh new file mode 100644 index 0000000000..9278409577 --- /dev/null +++ b/scripts/netlify-deploy-preview.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify build previews for a pull request +# https://docs.netlify.com/site-deploys/overview/#branches-and-deploys +### + +echo Branch: $HEAD +echo Branch deploy URL: $DEPLOY_PRIME_URL + +pushd themes/docs-new && npm install && popd +hugo --gc --minify --enableGitInfo --buildFuture diff --git a/scripts/netlify-deploy-production.sh b/scripts/netlify-deploy-production.sh new file mode 100644 index 0000000000..c868b73ff4 --- /dev/null +++ b/scripts/netlify-deploy-production.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify production builds +# https://docs.netlify.com/site-deploys/overview/#branches-and-deploys +### + +echo Branch: $HEAD +echo Branch deploy URL: $DEPLOY_PRIME_URL + +pushd themes/docs-new && npm install && popd +hugo --gc --minify --enableGitInfo