optimisation: run CI only when code changes
Closed this issue · 0 comments
alexbassy commented
problem:
CI is run for every change, e.g. README.md
solution:
check if out
directory is different in CI
proposed solution/workflow
-
build and export site
-
generate hash of
out
directoryfind ./out -type f -print0 | xargs -0 sha1sum | sha1sum
this:
- lists the files in the
out
directory as a long string - generate hash for all files with sha1sum
- hash that output, to see if there were any changes
- lists the files in the
-
compare this with the hash from the previous build
- if it has changed, upload the hash as a new artifact and continue with the rest of the steps in the workflow
- if it has not changed, do nothing
why i will not do this
- premature optimisation
- might introduce subtle bugs/conditions for deployment?
- i might want to periodically deploy new builds