Purge the cache from your deployment pipeline
A worked example: purge after a deploy, and fail the build if the purge fails.
The most common automation. Purge after deploying so visitors get the new build immediately.
#!/usr/bin/env bash
set -euo pipefail
SITE_ID="${WVC_SITE_ID:?set WVC_SITE_ID}"
TOKEN="${WVC_TOKEN:?set WVC_TOKEN}"
curl --fail --silent --show-error \
-X POST "https://api.webvuecloud.com/v1/sites/${SITE_ID}/cache/purge" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{"scope":"all"}'
echo "cache purged"Purging specific URLs
{
"scope": "urls",
"urls": [
"https://example.com/",
"https://example.com/pricing/"
]
}
In GitHub Actions
Store the token as a repository secret and reference it as ${{ secrets.WVC_TOKEN }}. Never echo it in a step, because build logs are often readable by more people than you think.
