diff --git a/.github/workflows/deploy-frontend-dev.yml b/.github/workflows/deploy-frontend-dev.yml index 682acd5bd..0373d14ce 100644 --- a/.github/workflows/deploy-frontend-dev.yml +++ b/.github/workflows/deploy-frontend-dev.yml @@ -36,10 +36,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 "/sitemap.xml" - name: Deploy cloudformation stack id: canopas-website-dev-lambda-stack-frontend @@ -52,5 +52,4 @@ jobs: no-fail-on-empty-changeset: "1" parameter-overrides: >- EnvName=dev, - ZipFileName=canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip, - CloudfrontURL=${{ secrets.CLOUDFRONT_URL_VALUE_DEV }} + ZipFileName=canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip \ No newline at end of file diff --git a/.github/workflows/deploy-frontend-prod.yml b/.github/workflows/deploy-frontend-prod.yml index 38c924373..fcc852870 100644 --- a/.github/workflows/deploy-frontend-prod.yml +++ b/.github/workflows/deploy-frontend-prod.yml @@ -37,10 +37,10 @@ jobs: mv config.prod.js config.js sh ./../deploy/generate-sitemap.sh https://canopas.com https://prod-stack-api.canopas.com yarn install --frozen-lockfile && yarn build - aws s3 rm s3://canopas-website-ssr-prod --recursive cd .output/server && zip canopas_website_SSR_prod_${{ github.sha }}-${{ github.run_attempt }}.zip -r . && aws s3 cp canopas_website_SSR_prod_${{ 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-prod aws s3 sync ./.output/public s3://canopas-website-ssr-prod + aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_PROD }} --paths "/sitemap.xml" - name: Deploy cloudformation stack id: canopas-website-prod-lambda-stack-frontend @@ -53,5 +53,4 @@ jobs: no-fail-on-empty-changeset: "1" parameter-overrides: >- EnvName=prod, - ZipFileName=canopas_website_SSR_prod_${{ github.sha }}-${{ github.run_attempt }}.zip, - CloudfrontURL=${{ secrets.CLOUDFRONT_URL_VALUE_PROD }} + ZipFileName=canopas_website_SSR_prod_${{ github.sha }}-${{ github.run_attempt }}.zip diff --git a/infrastructure/frontend.yml b/infrastructure/frontend.yml index 0b242e023..2985bfd25 100644 --- a/infrastructure/frontend.yml +++ b/infrastructure/frontend.yml @@ -17,75 +17,10 @@ Parameters: ZipFileName: Type: String Description: Name of the zip file. - CloudfrontURL: - Type: String - Description: Cloudfront URL. -Resources: - HttpApi: - Type: AWS::Serverless::HttpApi - Properties: - StageName: $default - Description: - Fn::Sub: Canopas Website SSR Frontend API ${EnvName} - DefinitionBody: - openapi: "3.0.1" - info: - title: - Fn::Sub: canopas-website-ssr-frontend-${EnvName} - version: "1.0" - paths: - /favicon.ico: - x-amazon-apigateway-any-method: - responses: - default: - description: "Default response for ANY /favicon.ico" - x-amazon-apigateway-integration: - payloadFormatVersion: "1.0" - type: "http_proxy" - httpMethod: "ANY" - uri: - Fn::Sub: "${CloudfrontURL}favicon.ico" - connectionType: "INTERNET" - /sitemap.xml: - x-amazon-apigateway-any-method: - responses: - default: - description: "Default response for ANY /sitemap.xml" - x-amazon-apigateway-integration: - payloadFormatVersion: "1.0" - type: "http_proxy" - httpMethod: "ANY" - uri: - Fn::Sub: "${CloudfrontURL}sitemap.xml" - connectionType: "INTERNET" - /robots.txt: - x-amazon-apigateway-any-method: - responses: - default: - description: "Default response for ANY /robots.txt" - x-amazon-apigateway-integration: - payloadFormatVersion: "1.0" - type: "http_proxy" - httpMethod: "ANY" - uri: - Fn::Sub: "${CloudfrontURL}robots.txt" - connectionType: "INTERNET" - /apple-touch-icon.png: - x-amazon-apigateway-any-method: - responses: - default: - description: "Default response for ANY /apple-touch-icon.png" - x-amazon-apigateway-integration: - payloadFormatVersion: "1.0" - type: "http_proxy" - httpMethod: "ANY" - uri: - Fn::Sub: "${CloudfrontURL}apple-touch-icon.png" - connectionType: "INTERNET" - x-amazon-apigateway-importexport-version: "1.0" - HttpApiFunction: +Resources: + SSRFunction: Type: AWS::Serverless::Function Properties: PackageType: Zip @@ -101,11 +36,5 @@ Resources: Fn::Sub: canopas-website-ssr-frontend-${EnvName} Description: Fn::Sub: Canopas Website SSR Frontend Lambda ${EnvName} - Events: - ProxyResource: - Type: HttpApi - Properties: - ApiId: - Ref: HttpApi - Path: $default - Method: any + FunctionUrlConfig: + AuthType: NONE \ No newline at end of file diff --git a/nuxt-frontend/config.js b/nuxt-frontend/config.js index e9e88a9af..506e3022b 100644 --- a/nuxt-frontend/config.js +++ b/nuxt-frontend/config.js @@ -70,6 +70,7 @@ export default Object.freeze({ blog: "https://blog.canopas.com", linkedin: "https://www.linkedin.com/company/canopasinc", youtube: "https://www.youtube.com/channel/UC77VyeTVJ45HiUS_o2GNcBA/videos", + github: "https://github.com/canopas", }, // SEO and meta data diff --git a/nuxt-frontend/config.prod.js b/nuxt-frontend/config.prod.js index 33c9b4047..95425a772 100644 --- a/nuxt-frontend/config.prod.js +++ b/nuxt-frontend/config.prod.js @@ -70,6 +70,7 @@ export default Object.freeze({ blog: "https://blog.canopas.com", linkedin: "https://www.linkedin.com/company/canopasinc", youtube: "https://www.youtube.com/channel/UC77VyeTVJ45HiUS_o2GNcBA/videos", + github: "https://github.com/canopas", }, // SEO and meta data