mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-16 14:14:11 +02:00
Auto-clear cache on deployment
This commit is contained in:
4
.github/workflows/cloudfront-cache.yml
vendored
4
.github/workflows/cloudfront-cache.yml
vendored
@@ -1,10 +1,6 @@
|
|||||||
name: Clears Cloudfront Cache
|
name: Clears Cloudfront Cache
|
||||||
on:
|
on:
|
||||||
# Allow manual Run
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
# Run at midnight utc
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
jobs:
|
jobs:
|
||||||
aws_costs:
|
aws_costs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
13
.github/workflows/deployment.yml
vendored
13
.github/workflows/deployment.yml
vendored
@@ -64,3 +64,16 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
cd /var/www/roadmap.sh
|
cd /var/www/roadmap.sh
|
||||||
sudo pm2 restart web-roadmap
|
sudo pm2 restart web-roadmap
|
||||||
|
|
||||||
|
# --------------------
|
||||||
|
# Clear cloudfront cache
|
||||||
|
# --------------------
|
||||||
|
- 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 } }'
|
Reference in New Issue
Block a user