https://github.com/foxdalas/cloudfront-invalidator
Github Action for Invalidate Cloudfront Cache
https://github.com/foxdalas/cloudfront-invalidator
actions aws cloudfront invalidate invalidate-cache
Last synced: about 1 year ago
JSON representation
Github Action for Invalidate Cloudfront Cache
- Host: GitHub
- URL: https://github.com/foxdalas/cloudfront-invalidator
- Owner: foxdalas
- License: mit
- Created: 2024-08-21T06:43:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-07T03:26:14.000Z (about 1 year ago)
- Last Synced: 2025-04-07T04:27:09.209Z (about 1 year ago)
- Topics: actions, aws, cloudfront, invalidate, invalidate-cache
- Language: JavaScript
- Homepage:
- Size: 5.48 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudfront Invalidator
This GitHub Action invalidates the CloudFront cache for specified paths by finding the CloudFront distribution based on tags.
## Usage
Use this action to invalidate specific paths in a CloudFront distribution. The action finds the CloudFront distribution using tags and invalidates the provided paths.
```yaml
- uses: foxdalas/cloudfront-invalidator@v1
with:
# Cloudfont distribution tag key to identify the distribution
tag_key: ""
# Cloudfront distribution tag value to identify the distribution
tag_value: ""
# Paths to invalidate. Provide paths in a JSON array format, e.g., '/path1, /path2'. Paths must start with a '/'
paths: '/index.html, /assets/*'
# Wait for the invalidation to complete. Default is true
wait: true
```
### Example Workflow
```yaml
name: Invalidate CloudFront Cache
on:
push:
branches:
- master
jobs:
invalidate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Invalidate CloudFront paths
uses: foxdalas/cloudfront-invalidator@v1
with:
tag_key: "Environment"
tag_value: "Production"
paths: "/index.html, /assets/*"
wait: true
```