30 lines
810 B
YAML
30 lines
810 B
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
env:
|
|
CF_ZONE_ID: "8a79e5c61c0a7033d7b0eca176665cd1"
|
|
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12
|
|
- run: |
|
|
mkdir -p $HOME/.wrangler
|
|
chmod -R 770 $HOME/.wrangler
|
|
- run: npm install --global @cloudflare/wrangler
|
|
- run: wrangler publish
|
|
- run: |
|
|
curl -X POST "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/purge_cache" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer $CF_API_TOKEN" \
|
|
--data '{"purge_everything":true}'
|