diff --git a/.gitignore b/.gitignore index e3850cf3be7..8e0e690db21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ .DS_Store +# Hugo/Go workspace files +*.work +*.work.sum + # ignore doctree files in translation folders *.doctree *.pickle @@ -26,6 +30,9 @@ static/fonts/fontawesome node_modules vendor +# dart-sass files for local dev testing +/dart-sass + # temp file created by hugo .hugo_build.lock diff --git a/netlify.toml b/netlify.toml index 197f3f56e23..78888c360f1 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 00000000000..df899314f86 --- /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 00000000000..21dbb733ef0 --- /dev/null +++ b/scripts/netlify-branch-deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify build previews +### + +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 00000000000..c88a6e8e189 --- /dev/null +++ b/scripts/netlify-deploy-preview.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify build previews for a pull request +### + +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 00000000000..21dbb733ef0 --- /dev/null +++ b/scripts/netlify-deploy-production.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eou pipefail + +### +# Generate Netlify build previews +### + +echo Branch: $HEAD +echo Branch deploy URL: $DEPLOY_PRIME_URL + +pushd themes/docs-new && npm install && popd +hugo --gc --minify --enableGitInfo