-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create cloudformation stack for SSR lambda deployment
- Loading branch information
Showing
19 changed files
with
116 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: DeployFrontendTestLambda | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
deploy-backend-prod: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-frontend-access | ||
aws-region: ap-south-1 | ||
|
||
- name: Build frontend and copy zip to S3 | ||
run: | | ||
cd nuxt-frontend | ||
sed -i "s|VITE_IFRAMELY_KEY_VALUE|${{ secrets.IFRAMELY_KEY }}|g" config.js | ||
sed -i "s|VITE_RECAPTCHA_SITE_KEY_VALUE|${{ secrets.RECAPTCHA_SITE_KEY }}|g" config.js | ||
sed -i "s|RESOURCES_URL|${{ secrets.RESOURCES_URL }}|g" config.js | ||
sed -i "s|CLOUDFRONT_URL_VALUE|${{ secrets.CLOUDFRONT_URL_VALUE }}|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 sync ./.output/public s3://canopas-website-static --exclude "*.js" | ||
aws s3 sync ./.output/public s3://canopas-website-static --include "*.js" --content-type "application/javascript" | ||
- name: Deploy cloudformation stack | ||
id: canopas-website-prod-lambda-stack-frontend | ||
uses: aws-actions/aws-cloudformation-github-deploy@v1 | ||
with: | ||
name: canopas-website-prod-lambda-stack-frontend | ||
template: infrastructure/frontend-test.yml | ||
capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM | ||
timeout-in-minutes: "10" | ||
no-fail-on-empty-changeset: "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: NuxtJS deployment with AWS Lambda function | ||
Resources: | ||
HttpApi: | ||
Type: AWS::Serverless::HttpApi | ||
Properties: | ||
StageName: $default | ||
Name: canopas website lambda frontend | ||
|
||
HttpApiFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: .output/server/ | ||
Handler: index.handler | ||
Runtime: nodejs20.x | ||
Architectures: | ||
- x86_64 | ||
MemorySize: 128 | ||
Timeout: 100 | ||
Description: Nuxt 3 SSR Lambda | ||
Events: | ||
ProxyResource: | ||
Type: HttpApi | ||
Properties: | ||
ApiId: | ||
Ref: HttpApi | ||
Path: $default | ||
Method: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.