Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy using sh scripts #4255

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading