Skip to content

Commit

Permalink
Deploy using sh scripts (#4255)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Maddaus <[email protected]>
  • Loading branch information
IanMadd authored Mar 25, 2024
1 parent 99e0b59 commit 9680d90
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 4 deletions.
8 changes: 4 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
12 changes: 12 additions & 0 deletions scripts/local-server.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions scripts/netlify-branch-deploy.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions scripts/netlify-deploy-preview.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions scripts/netlify-deploy-production.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9680d90

Please sign in to comment.