mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-01-17 06:08:36 +01:00
Take out cloudfront cache busting into a separate github action
This commit is contained in:
parent
f77bfc499f
commit
a1710b17c8
20
.github/workflows/cloudfront-cache.yml
vendored
Normal file
20
.github/workflows/cloudfront-cache.yml
vendored
Normal file
@ -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 } }'
|
15
.github/workflows/deployment.yml
vendored
15
.github/workflows/deployment.yml
vendored
@ -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…
x
Reference in New Issue
Block a user