diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 607dc95..a0d85e9 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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