Skip to content

Commit e197f8b

Browse files
authored
[skip ci][DO] Add cache purger on both CF and DO CDN
TODO: add CF's purge cache token when @neon-nyan finally creates it Former-commit-id: 8b7c70ea10e9a963b1bb57b6f716c01bd54e935a [formerly 3e887fe] Former-commit-id: 42df6fac8849b3c5cc8edeeb212b4ab0824d6148
1 parent 451bd0e commit e197f8b

File tree

7 files changed

+117
-5
lines changed

7 files changed

+117
-5
lines changed

.github/workflows/upload-do-Hi3CN.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,19 @@ jobs:
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
3131
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-do-Hi3Global.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ jobs:
2828
source: '${{ env.DESTINATION-PATH }}'
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
31-
versioning: false
31+
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-do-Hi3JP.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ jobs:
2828
source: '${{ env.DESTINATION-PATH }}'
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
31-
versioning: false
31+
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-do-Hi3KR.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ jobs:
2828
source: '${{ env.DESTINATION-PATH }}'
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
31-
versioning: false
31+
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-do-Hi3SEA.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ jobs:
2828
source: '${{ env.DESTINATION-PATH }}'
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
31-
versioning: false
31+
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-do-Hi3TW.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ jobs:
2828
source: '${{ env.DESTINATION-PATH }}'
2929
out_dir: '${{ env.DESTINATION-PATH }}'
3030
cdn_domain: ${{ env.CDN-URL }}
31-
versioning: false
31+
versioning: false
32+
33+
- name: Install doctl
34+
uses: digitalocean/action-doctl@v2
35+
with:
36+
token: ${{ secrets.DO_PURGE_TOKEN }}
37+
38+
- name: Purge DigitalOcean cache
39+
run: |
40+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
41+
42+
- name: Purge Cloudflare cache
43+
run: |
44+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
45+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
46+
-H "Content-Type: application/json" \
47+
--data "{ \"purge_everything\": true }"

.github/workflows/upload-to-do.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,19 @@ jobs:
3333
out_dir: '${{ env.DESTINATION-PATH }}'
3434
cdn_domain: ${{ env.CDN-URL }}
3535
versioning: false
36+
37+
- name: Install doctl
38+
uses: digitalocean/action-doctl@v2
39+
with:
40+
token: ${{ secrets.DO_PURGE_TOKEN }}
41+
42+
- name: Purge DigitalOcean cache
43+
run: |
44+
doctl compute cdn flush a94b5dfc-8dfe-4060-99ec-14526d813c22 --verbose --files ${{ env.DESTINATION-PATH }}/*
45+
46+
- name: Purge Cloudflare cache
47+
run: |
48+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID_CL }}/purge_cache" \
49+
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN_CL }}" \
50+
-H "Content-Type: application/json" \
51+
--data "{ \"purge_everything\": true }"

0 commit comments

Comments
 (0)