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

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

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

KeyValueTypeRequired
DISTRIBUTION_IDThe ID of the cloudfront distribution to create the invalidation forenvYes
PATH_TO_INVALIDATEPath to invalidate. For example, /myfolder/myfile.png.envYes
AWS_REGIONThe region where you created your bucket in. For example, us-east-1. Defaults to us-east-1 if not specifiedenvNo

Required Secret Variables

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

KeyValueTypeRequired
AWS_ACCESS_KEY_IDYour AWS Access Key. More info here.secretYes
AWS_SECRET_ACCESS_KEYYour AWS Secret Access Key. More info here.secretYes

License

This project is distributed under the MIT license.

About

Simple github action to invalidate a path in AWS Cloudfront

Topics

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages