Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Simple github action to invalidate a path in AWS Cloudfront

License

Notifications You must be signed in to change notification settings

rewindio/github-action-cloudfront-invalidate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-action-cloudfront-invalidate

Github action to invalidate a path in an AWS Cloudfront distribution. This is heavily based on the excellent work from Jake Jarvis with his sync action

Usage

workflow.yml Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

name: Invalidate Cloudfront
on: push

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@master

    - name: Invalidate Cloudfront
      uses: docker://rewindio/github-action-cloudfront-invalidate
      env:
        DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
        PATH_TO_INVALIDATE: /myfolder/myfile.png
        AWS_REGION: us-east-1
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Environment Variables

Key Value Type Required
DISTRIBUTION_ID The ID of the cloudfront distribution to create the invalidation for env Yes
PATH_TO_INVALIDATE Path to invalidate. For example, /myfolder/myfile.png. env Yes
AWS_REGION The region where you created your bucket in. For example, us-east-1. Defaults to us-east-1 if not specified env No

Required Secret Variables

The following variables should be added as "secrets" in the action's configuration.

Key Value Type Required
AWS_ACCESS_KEY_ID Your AWS Access Key. More info here. secret Yes
AWS_SECRET_ACCESS_KEY Your AWS Secret Access Key. More info here. secret Yes

License

This project is distributed under the MIT license.

About

Simple github action to invalidate a path in AWS Cloudfront

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published