From dd8df232fb561ace6b70997f99bf86602f9027dd Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 12 Jun 2020 22:26:40 +0530 Subject: 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 --- .github/workflows/deploy_snapshot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml index 4ec15a2a..55086c17 100644 --- a/.github/workflows/deploy_snapshot.yml +++ b/.github/workflows/deploy_snapshot.yml @@ -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 }} -- cgit v1.2.3