File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Preview Deployment
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ concurrency :
8+ group : preview-deployment
9+ cancel-in-progress : false
10+
11+ jobs :
12+ deploy-preview :
13+ if : github.event.pull_request.head.repo.full_name == github.repository
14+ runs-on : ubuntu-latest
15+ environment : AWS Preview
16+ env :
17+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
18+ AWS_HANDLER_VERIFY_HEADER : ${{ secrets.AWS_HANDLER_VERIFY_HEADER }}
19+ AWS_REGION : ${{ vars.AWS_REGION }}
20+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+ GOOGLE_SEARCH_API_KEY : ${{ secrets.GOOGLE_SEARCH_API_KEY }}
22+ GOOGLE_SEARCH_SEARCH_ENGINE_ID :
23+ ${{ secrets.GOOGLE_SEARCH_SEARCH_ENGINE_ID }}
24+ OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
25+ UPSTASH_REDIS_REST_TOKEN : ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
26+ UPSTASH_REDIS_REST_URL : ${{ secrets.UPSTASH_REDIS_REST_URL }}
27+ steps :
28+ - name : Checkout
29+ uses : actions/checkout@v4
30+ - name : Setup Node.js
31+ uses : actions/setup-node@v4
32+ with :
33+ node-version-file : ' .node-version'
34+ cache : ' npm'
35+ - name : Install
36+ run : npm ci --no-audit --no-fund
37+ - name : Build
38+ run : npm run build
39+ - name : Deploy Preview
40+ run : npm run deploy:preview -- --require-approval never
Original file line number Diff line number Diff line change 1+ import * as cdk from 'aws-cdk-lib' ;
2+ import './env.js' ;
3+ import { Stack } from './stack.js' ;
4+
5+ const app = new cdk . App ( ) ;
6+
7+ new Stack ( app , `mfng-ai-demo-preview` , {
8+ env : {
9+ account : process . env . CDK_DEFAULT_ACCOUNT ,
10+ // A web ACL with CLOUDFRONT scope, and the certificate for CloudFront, must
11+ // both be created in the US East (N. Virginia) Region, us-east-1.
12+ region : `us-east-1` ,
13+ } ,
14+ bucketName : `mfng-ai-demo-preview-assets` ,
15+ customDomain : {
16+ domainName : `strict.software` ,
17+ subdomainName : `ai-demo-preview.mfng` ,
18+ } ,
19+ webAclName : `mfng-ai-demo-preview` ,
20+ } ) ;
Original file line number Diff line number Diff line change 1515 "compile:watch" : " tsc --build --watch --preserveWatchOutput" ,
1616 "predeploy" : " cdk bootstrap --app 'tsx cdk/app.ts'" ,
1717 "deploy" : " cdk diff --app 'tsx cdk/app.ts' && cdk deploy --app 'tsx cdk/app.ts' --all" ,
18+ "deploy:preview" : " cdk diff --app 'tsx cdk/app-preview.ts' && cdk deploy --app 'tsx cdk/app-preview.ts' --all" ,
1819 "dev" : " turbo watch:dev start" ,
1920 "format:check" : " prettier --check ." ,
2021 "format:write" : " prettier --write ." ,
You can’t perform that action at this time.
0 commit comments