Skip to content

Commit 94aa572

Browse files
authored
Merge pull request #184 from w3c/actions-upgrade
upgrade actions/checkout and use CF API to invalidate cache instead of a GH action
2 parents 0d995d2 + d0cca76 commit 94aa572

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

.github/workflows/deploy-assets-dev.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
destination: assets/website-2021/
1212
steps:
1313
- name: Checkout source Git branch
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v5
1515

1616
- name: Use Node.js
1717
uses: actions/setup-node@v2
@@ -34,9 +34,9 @@ jobs:
3434
aws s3 sync --no-progress ${{ env.source }} s3://cdn-dev.w3.org/${{ env.destination }}
3535

3636
- name: Purge cache for www-dev.w3.org
37-
uses: nathanvaughn/actions-cloudflare-purge@master
3837
if: success()
39-
with:
40-
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
41-
cf_auth: ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}
42-
prefixes: www-dev.w3.org/${{ env.destination }}
38+
run: |
39+
curl -s --max-time 20 -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
40+
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}" \
41+
-H "Content-Type: application/json" \
42+
--data "{\"prefixes\":[\"www-dev.w3.org/${{ env.destination }}\"]}"

.github/workflows/deploy-assets-staging.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
destination: assets/website-2021/
1212
steps:
1313
- name: Checkout source Git branch
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v5
1515

1616
- name: Use Node.js
1717
uses: actions/setup-node@v2
@@ -34,9 +34,9 @@ jobs:
3434
aws s3 sync --no-progress ${{ env.source }} s3://cdn-staging.w3.org/${{ env.destination }}
3535

3636
- name: Purge cache for www-staging.w3.org
37-
uses: nathanvaughn/actions-cloudflare-purge@master
3837
if: success()
39-
with:
40-
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
41-
cf_auth: ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}
42-
prefixes: www-staging.w3.org/${{ env.destination }}
38+
run: |
39+
curl -s --max-time 20 -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
40+
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}" \
41+
-H "Content-Type: application/json" \
42+
--data "{\"prefixes\":[\"www-staging.w3.org/${{ env.destination }}\"]}"

.github/workflows/deploy-assets.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
destination: assets/website-2021/
1212
steps:
1313
- name: Checkout source Git branch
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v5
1515

1616
- name: Use Node.js
1717
uses: actions/setup-node@v2
@@ -34,9 +34,9 @@ jobs:
3434
aws s3 sync --no-progress ${{ env.source }} s3://cdn.w3.org/${{ env.destination }}
3535

3636
- name: Purge cache for www.w3.org
37-
uses: nathanvaughn/actions-cloudflare-purge@master
3837
if: success()
39-
with:
40-
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
41-
cf_auth: ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}
42-
prefixes: www.w3.org/${{ env.destination }}
38+
run: |
39+
curl -s --max-time 20 -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
40+
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}" \
41+
-H "Content-Type: application/json" \
42+
--data "{\"prefixes\":[\"www.w3.org/${{ env.destination }}\"]}"

.github/workflows/deploy-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
destination: assets/website-2021-dev/pr-${{ github.event.number }}/
1111
steps:
1212
- name: Checkout source Git branch
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v5
1414
with:
1515
ref: ${{github.event.pull_request.head.ref}}
1616
persist-credentials: false

0 commit comments

Comments
 (0)