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 d7e1f44 commit 31634f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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 @@ -31,10 +31,10 @@ jobs:
sed -i "s|CLOUDFRONT_URL_VALUE|${{ secrets.CLOUDFRONT_URL_VALUE_DEV }}|g" config.js
sh ./../deploy/generate-sitemap.sh https://dev-stack.canopas.com https://dev-stack-api.canopas.com
yarn install --frozen-lockfile && yarn build
aws s3 rm s3://canopas-website-ssr-dev --recursive
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 "/*"
- name: Deploy cloudformation stack
id: canopas-website-dev-lambda-stack-frontend
Expand Down
20 changes: 17 additions & 3 deletions infrastructure/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,31 @@ Resources:
- OPTIONS
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
OriginRequestPolicyId: 88a5eaf4-2fd4-4709-b370-b4c650ea3fcf
ResponseHeaderPolicyId: 5cc3b908-e619-4b99-88e5-2cf7f45965bd
ResponseHeadersPolicyId: 5cc3b908-e619-4b99-88e5-2cf7f45965bd
TargetOriginId: StaticS3
ViewerProtocolPolicy: redirect-to-https
- PathPattern: /sitemap.xml
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
OriginRequestPolicyId: 88a5eaf4-2fd4-4709-b370-b4c650ea3fcf
ResponseHeaderPolicyId: 5cc3b908-e619-4b99-88e5-2cf7f45965bd
TargetOriginId: StaticS3
ViewerProtocolPolicy: redirect-to-https

Expand Down

0 comments on commit 31634f9

Please sign in to comment.