Skip to content

Commit

Permalink
netlify: try to fix dirty build detection
Browse files Browse the repository at this point in the history
  • Loading branch information
benesch committed Feb 3, 2020
1 parent 702559e commit 244dfab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ci/www/changed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Copyright 2019 Materialize, Inc. All rights reserved.
#
# This file is part of Materialize. Materialize may not be used or
# distributed without the express permission of Materialize, Inc.
#
# changed.sh — determines whether Netlify should rebuild the website.

set -euo pipefail

cd "$(dirname "$0")/../.."

branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$branch" = master ]]; then
spec=HEAD^
else
spec=master...
fi

# Netlify doesn't follow symlinks as of 03 Feb 2020, so we need to explicitly
# check for changes in doc/user too.
exec git diff --quiet "$spec" -- doc/user www
1 change: 1 addition & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
base = "www"
publish = "public"
command = "hugo --gc --baseURL $URL"
ignore = "../ci/www/changed.sh"
environment = { HUGO_VERSION = "0.58.3" }

[context.deploy-preview]
Expand Down

0 comments on commit 244dfab

Please sign in to comment.