spec-prod icon indicating copy to clipboard operation
spec-prod copied to clipboard

deploy/gh-pages: Avoid unnecessary deploys

Open sidvishnoi opened this issue 5 years ago • 2 comments

Do not deploy if nothing other than the publish date (and similar things) have changed.

sidvishnoi avatar Aug 25 '20 12:08 sidvishnoi

In a ReSpec document, the "no-diff" looks like following: image

Edit: above can be filtered with:

git show -p -U0 --diff-filter=M \
  | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' \ # https://stackoverflow.com/a/26622262
  | grep -v publishISODate \
  | grep -Ev "meta.+generator" \
  | grep -v "dt-published" \
  | grep -Pv "generatedSubtitle.+\d{1,2} \w+ \d{4}"
  | cat # avoid error-exit on no match.

sidvishnoi avatar Aug 25 '20 18:08 sidvishnoi

An alternative could be to use puppeteer and set the "no-diff" fields (like dates, meta[generator]) to same values using DOM manipulation, and then compare resulting (prettified) HTML.

sidvishnoi avatar Sep 03 '21 20:09 sidvishnoi