Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

invalidate-cloudfront #772

invalidate-cloudfront

invalidate-cloudfront #772

name: invalidate-cloudfront
# additional invalidation to catch missed invalidations from prior jobs - not strictly needed at the moment
# runs once every morning and can be run manually
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '25 17 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
my_job:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
# doc on invalidation paths: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects-paths
- name: Invalidate Cloudfront
run: AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id EHNPIZWYYWA31 --paths "/data*"