Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CloudFront Cache Invalidation Path in GitHub Actions Deployment Example #2456

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

be-next
Copy link
Contributor

@be-next be-next commented Mar 17, 2024

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Description

This pull request addresses an issue in the GitHub Actions workflow example for deploying a website to an AWS S3 bucket with CloudFront distribution. Previously, the workflow was configured to invalidate the CloudFront cache using the path "invalidation: /", which does not effectively clear the cached content across the entire distribution.

Problem

The original cache invalidation directive "invalidation: /" in the GitHub Actions configuration file does not correctly specify the path pattern for CloudFront to invalidate. According to AWS CloudFront documentation, to invalidate all files, the path pattern must be specified as "/*". The incorrect path specification led to situations where updated content was not properly served due to the old cached versions persisting in CloudFront.

Solution

This pull request corrects the cache invalidation path by changing the directive from "invalidation: /" to "invalidation: /*" within the GitHub Actions workflow file. This ensures that all files are correctly invalidated in the CloudFront distribution, allowing for updated content to be served immediately after deployment.

@Keats Keats merged commit 9a5e95c into getzola:master Mar 18, 2024
5 checks passed
@Keats
Copy link
Collaborator

Keats commented Mar 18, 2024

Thanks!

veluca93 pushed a commit to veluca93/zola that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants