Fix WebDAV deploy: DELETE-then-PUT to bypass stale-file cache
All checks were successful
Test, Build & Deploy / test-and-build (push) Successful in 38s
Test, Build & Deploy / deploy (push) Successful in 20s

The serving layer caches uploaded files, so a plain PUT over the existing
index.html returned 201 but kept serving the old copy, failing the
verify step. Delete first, then PUT (single-line curls: YAML block
scalars don't process backslash continuations).
This commit is contained in:
hermes-explorigin 2026-08-30 19:03:38 +00:00
parent 38f0c04b3e
commit 09cea275b7

View File

@ -73,11 +73,12 @@ jobs:
echo "::error::Add them under Settings → Actions → Secrets, then re-run this job."
exit 1
fi
curl -sS --fail \
-u "$WEBDAV_USER:$WEBDAV_PASS" \
-X PUT -T dist/index.html \
-H 'Content-Type: text/html' \
"$WEBDAV_URL"
# DELETE-then-PUT: the serving layer caches uploaded files, so a plain
# PUT over an existing file returns 201 but keeps serving the OLD copy.
# Deleting first guarantees the new build is actually served. (Each curl
# is a single line -- YAML block scalars don't convert backslash-nl.)
curl -sS -u "$WEBDAV_USER:$WEBDAV_PASS" -X DELETE "$WEBDAV_URL" || echo "(DELETE returned non-zero; file may not exist yet -- continuing)"
curl -sS --fail -u "$WEBDAV_USER:$WEBDAV_PASS" -X PUT -T dist/index.html -H 'Content-Type: text/html' "$WEBDAV_URL"
echo "Published to $WEBDAV_URL"
# Pull the freshly uploaded file back and compare it to our build, so a