spec-prod
spec-prod copied to clipboard
deploy/gh-pages: Avoid unnecessary deploys
Do not deploy if nothing other than the publish date (and similar things) have changed.
In a ReSpec document, the "no-diff" looks like following:

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.
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.