Skip to content

Commit

Permalink
Add cloudfront distributiom
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sumi-k committed Feb 19, 2024
1 parent 31634f9 commit 60fbd15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cd .output/server && zip canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip -r . && aws s3 cp canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip s3://canopas-lambda-handlers && cd ../..
aws s3 sync --cache-control 'max-age=604800' --exclude *.html ./.output/public s3://canopas-website-ssr-dev
aws s3 sync ./.output/public s3://canopas-website-ssr-dev
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }} --paths "/*"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }} --paths "/sitemap.xml"
- name: Deploy cloudformation stack
id: canopas-website-dev-lambda-stack-frontend
Expand Down
7 changes: 3 additions & 4 deletions infrastructure/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ Resources:
HTTPPort: 80
HTTPSPort: 443
OriginProtocolPolicy: match-viewer
OriginSSLProtocols: TLSv1.2
- DomainName: canopas-website-ssr-dev.s3.ap-south-1.amazonaws.com
Id: StaticS3
OriginAccessControlId: canopas-website-ssr-dev.s3.ap-south-1.amazonaws.com
CustomOriginConfig:
HTTPPort: 80
HTTPSPort: 443
OriginProtocolPolicy: match-viewer
OriginSSLProtocols: TLSv1.2
Enabled: 'true'
DefaultCacheBehavior:
AllowedMethods:
Expand All @@ -78,7 +81,6 @@ Resources:
AllowedMethods:
- GET
- HEAD
- OPTIONS
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
OriginRequestPolicyId: 88a5eaf4-2fd4-4709-b370-b4c650ea3fcf
ResponseHeadersPolicyId: 5cc3b908-e619-4b99-88e5-2cf7f45965bd
Expand All @@ -88,23 +90,20 @@ Resources:
AllowedMethods:
- GET
- HEAD
- OPTIONS
CachePolicyId: 4135ea2d-6df8-44a3-9df3-4b5a84be39ad
TargetOriginId: StaticS3
ViewerProtocolPolicy: redirect-to-https
- PathPattern: /robots.txt
AllowedMethods:
- GET
- HEAD
- OPTIONS
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
TargetOriginId: StaticS3
ViewerProtocolPolicy: redirect-to-https
- PathPattern: /favicon.ico
AllowedMethods:
- GET
- HEAD
- OPTIONS
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
TargetOriginId: StaticS3
ViewerProtocolPolicy: redirect-to-https
Expand Down

0 comments on commit 60fbd15

Please sign in to comment.