Skip to content

Commit

Permalink
[GitHub Actions] Emscripten workflow tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Feb 16, 2024
1 parent a877546 commit 688ebfa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish_web_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
WZ_CDN_BASE_URL="$(echo "${INPUT_CDN_PURGE_BASE_URL}" | sed 's:/*$::')"
echo "WZ_CDN_BASE_URL=${WZ_CDN_BASE_URL}" >> $GITHUB_ENV
echo "WZ_CDN_BASE_URL=${WZ_CDN_BASE_URL}" >> $GITHUB_OUTPUT
# Determine base CDN url hostname
WZ_CDN_BASE_HOSTNAME="$(echo "${INPUT_CDN_PURGE_BASE_URL}" | cut -f1 -d/)"
echo "WZ_CDN_BASE_HOSTNAME=${WZ_CDN_BASE_HOSTNAME}" >> $GITHUB_ENV
echo "WZ_CDN_BASE_HOSTNAME=${WZ_CDN_BASE_HOSTNAME}" >> $GITHUB_OUTPUT
- name: Download Archive Artifact
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -185,6 +189,12 @@ jobs:
-H "Authorization: Bearer ${CLOUDFLARE_CACHEPURGE_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary "@$file"
# Separately clear any cache keys that include the Origin
curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \
-H "Authorization: Bearer ${CLOUDFLARE_CACHEPURGE_TOKEN}" \
-H "Content-Type: application/json" \
-H "Origin: https://${WZ_CDN_BASE_HOSTNAME}" \
--data-binary "@$file"
done; # file
echo "Done with main purge ..."
sleep 30 # Wait and then trigger a purge for just the service worker files
Expand All @@ -195,5 +205,11 @@ jobs:
-H "Authorization: Bearer ${CLOUDFLARE_CACHEPURGE_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary "@$file"
# Separately clear any cache keys that include the Origin
curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \
-H "Authorization: Bearer ${CLOUDFLARE_CACHEPURGE_TOKEN}" \
-H "Content-Type: application/json" \
-H "Origin: https://${WZ_CDN_BASE_HOSTNAME}" \
--data-binary "@$file"
done; # file
echo "Done."

0 comments on commit 688ebfa

Please sign in to comment.