github: add flow to purge Cloudflare cache after snapshot deploy (#848)

This will ensure that APKs served from Cloudflare's edge will always be fresh.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2020-06-12 22:26:40 +05:30
committed by GitHub
parent d8231e112a
commit dd8df232fb

View File

@@ -66,3 +66,16 @@ jobs:
SERVER_ADDRESS: ${{ secrets.SERVER_ADDRESS }}
SERVER_DESTINATION: ${{ secrets.SERVER_DESTINATION }}
SSH_PORT: ${{ secrets.SSH_PORT }}
- name: Install NodeJS
uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Install cfcli
run: npm install -g cloudflare-cli
- name: Purge Cloudflare cache
run: cfcli --token ${CF_TOKEN} purge "https://dl.msfjarvis.dev/APS/$(cd ./app/build/outputs/apk/release/; ls *.apk)"
env:
CF_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}