Spun up from a different thread, I am trying the deploy
command out. It appears the workflow is:
- build the site with
hugo
- deploy the site with
hugo deploy
The way I understand it to work is that the deploy
command looks for new/updated/deleted files and only uploads the delta + removes the deleted ones.
So I tried this:
- build site with
hugo
- deploy site with
hugo deploy --force --maxDelete -1
… everything gets uploaded (at this point, all is working) - update an existing file
- build & deploy
hugo && hugo deploy --maxDelete -1
… I see hugo only uploads one file… perfect! - add a new file
- build & deploy
hugo && hugo deploy --maxDelete -1
… I see hugo only uploads a few files (the new page + a few summary pages where it should appear, sitemap, rss, etc… all expected)… perfect! - delete a file
- build & deploy
hugo && hugo deploy --maxDelete -1
… hugo uploads 3500+ files & 0 deletes… huh? - delete the built folder, then rebuild & deploy
rm -rf public && hugo && hugo deploy --maxDelete -1
… hugo 2 files & 1 deletes… expected!
In the second to last test (#8), I don’t understand why so many files are uploaded & none are deleted. Does this make sense to someone else?
My builds are in a CI/CD process so each build will always create a clean /public
folder like I’m doing in step 9 above, so the outcome is fine, but what’s going on with step 8 above is raising a flag…