Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Invalidate CloudFront distribution on main branch
if: github.ref == 'refs/heads/main'
run: |
aws cloudfront create-invalidation --distribution-id E12E3K1OI02YXE --paths "/*"
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider storing the CloudFront distribution ID as a repository secret or environment variable instead of hardcoding it. This would improve security and maintainability, especially if the distribution ID needs to change or if you want to use different distributions for different environments.

Example:

run: |
  aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
Suggested change
aws cloudfront create-invalidation --distribution-id E12E3K1OI02YXE --paths "/*"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"

Copilot uses AI. Check for mistakes.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Add deployment link to summary
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
Expand Down