Skip to content

Commit d927817

Browse files
Kade-NRosalie241
authored andcommitted
ci: purge cache on cloudflare upload to ensure users receive latest update
1 parent 601e430 commit d927817

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,15 @@ jobs:
147147
r2-bucket: spore-modapi-launcherkit
148148
source-dir: artifact
149149
destination-dir: ./
150-
150+
- name: Purge Cloudflare Cache
151+
env:
152+
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
153+
CF_PURGECACHE_TOKEN: ${{ secrets.CF_PURGECACHE_TOKEN }}
154+
run: |
155+
$params = @{
156+
Method = 'POST'
157+
Uri = "https://api.cloudflare.com/client/v4/zones/$env:CF_ZONE_ID/purge_cache"
158+
Headers = @{Authorization="Bearer $env:CF_PURGECACHE_TOKEN"}
159+
Body = '{"hosts":["update.launcherkit.sporecommunity.com"]}'
160+
}
161+
Invoke-WebRequest @params

0 commit comments

Comments
 (0)