Anchor rsync excludes to transfer root

--exclude=index.html matches index.html at every depth, which stripped
prerendered index.html files from subdirectories. Anchoring with a
leading slash limits the exclude to the transfer root so only the root
index.html is skipped.
This commit is contained in:
Alex Gleason committed 2026-04-29 15:44:36 -05:00
1 parent 6f3cc62e00
commit 0da339c214
1 file changed
+1 -1
+1 -1
View File
@@ -42,7 +42,7 @@ deploy:
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "$DEPLOY_SSH_KEY" | tr -d '\r' > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
- ssh-keyscan -H "${DEPLOY_TARGET##*@}" >> ~/.ssh/known_hosts 2>/dev/null
- rsync -av --exclude=sw.js --exclude=index.html -e "ssh -i ~/.ssh/id_ed25519" dist/ "${DEPLOY_TARGET}:/"
- rsync -av --exclude=/sw.js --exclude=/index.html -e "ssh -i ~/.ssh/id_ed25519" dist/ "${DEPLOY_TARGET}:/"
- rsync -av -e "ssh -i ~/.ssh/id_ed25519" dist/index.html "${DEPLOY_TARGET}:/"
deploy-nsite: