Take out cloudfront cache busting into a separate github action

pull/5577/head
Kamran Ahmed 7 months ago
parent f77bfc499f
commit a1710b17c8
  1. 20
      .github/workflows/cloudfront-cache.yml
  2. 15
      .github/workflows/deployment.yml

@ -0,0 +1,20 @@
name: Clears Cloudfront Cache
on:
# Allow manual Run
workflow_dispatch:
# Run at midnight utc
schedule:
- cron: '0 0 * * *'
jobs:
aws_costs:
runs-on: ubuntu-latest
steps:
- name: Clear Cloudfront Caching
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/roadmapsh/infra-ansible/actions/workflows/playbook.yml/dispatches \
-d '{ "ref":"master", "inputs": { "playbook": "roadmap_web.yml", "tags": "cloudfront", "is_verbose": false } }'

@ -59,17 +59,4 @@ jobs:
key: ${{ secrets.EC2_PRIVATE_KEY }} key: ${{ secrets.EC2_PRIVATE_KEY }}
script: | script: |
cd /var/www/roadmap.sh cd /var/www/roadmap.sh
sudo pm2 restart web-roadmap sudo pm2 restart web-roadmap
# --------------------
# Clear Cloudfront Caching
# --------------------
- name: Clear Cloudfront Caching
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/roadmapsh/infra-ansible/actions/workflows/playbook.yml/dispatches \
-d '{ "ref":"master", "inputs": { "playbook": "roadmap_web.yml", "tags": "cloudfront", "is_verbose": false } }'
Loading…
Cancel
Save