-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (31 loc) · 1.06 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Deployment
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: f23d3bdabedf584dc8bd8fb94b41190e
projectName: backendisti
directory: web
branch: ${{ github.ref_name == 'master' && 'main' || github.ref_name }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Purge cache
env:
zone_id: "4604dc5827876a558829b184668da310"
api_token: "${{ secrets.CLOUDFLARE_API_TOKEN }}"
run: |
curl -fsX POST \
-H 'Authorization: Bearer ${{ env.api_token }}' \
-H 'Content-Type: application/json' \
--data '{"purge_everything": true}' \
https://api.cloudflare.com/client/v4/zones/${{ env.zone_id }}/purge_cache