Skip to content

Commit 418aabf

Browse files
committed
Fix cloudflare blocking CD
1 parent 3ec28a0 commit 418aabf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/build-frontend.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
env:
2121
SHOULD_PUSH: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && secrets.DOCKER_REGISTRY_USERNAME != '' }}
22+
DEPLOYMENT_WEBHOOK_URL: ${{ secrets.DEPLOYMENT_WEBHOOK_URL }}
2223
steps:
2324
- name: Checkout
2425
uses: actions/checkout@v4
@@ -55,12 +56,18 @@ jobs:
5556
labels: ${{ steps.meta.outputs.labels }}
5657
cache-from: type=gha,scope=frontend
5758
cache-to: type=gha,mode=max,scope=frontend
59+
5860
# webhook to trigger deployment
61+
# only trigger on new tags and if the DEPLOYMENT_WEBHOOK_URL secret is set
62+
- name: Bypass Cloudflare for GitHub Action
63+
continue-on-error: true
64+
if: env.SHOULD_PUSH == 'true' && env.DEPLOYMENT_WEBHOOK_URL != ''
65+
uses: xiaotianxt/[email protected]
66+
with:
67+
cf_zone_id: ${{ secrets.CF_ZONE_ID }}
68+
cf_api_token: ${{ secrets.CF_API_TOKEN }}
5969
- name: Deploy
60-
env:
61-
DEPLOYMENT_WEBHOOK_URL: ${{ secrets.DEPLOYMENT_WEBHOOK_URL }}
6270
continue-on-error: true
63-
# only trigger on new tags and if the DEPLOYMENT_WEBHOOK_URL secret is set
6471
if: env.SHOULD_PUSH == 'true' && env.DEPLOYMENT_WEBHOOK_URL != ''
6572
uses: wei/curl@v1
6673
with:

0 commit comments

Comments
 (0)