-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
619cd4b
commit cfe5035
Showing
3 changed files
with
61 additions
and
0 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,40 @@ | ||
name: Preview Deployment | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
concurrency: | ||
group: preview-deployment | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy-preview: | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
runs-on: ubuntu-latest | ||
environment: AWS Preview | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_HANDLER_VERIFY_HEADER: ${{ secrets.AWS_HANDLER_VERIFY_HEADER }} | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
GOOGLE_SEARCH_API_KEY: ${{ secrets.GOOGLE_SEARCH_API_KEY }} | ||
GOOGLE_SEARCH_SEARCH_ENGINE_ID: | ||
${{ secrets.GOOGLE_SEARCH_SEARCH_ENGINE_ID }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} | ||
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'npm' | ||
- name: Install | ||
run: npm ci --no-audit --no-fund | ||
- name: Build | ||
run: npm run build | ||
- name: Deploy Preview | ||
run: npm run deploy:preview -- --require-approval never |
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,20 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import './env.js'; | ||
import {Stack} from './stack.js'; | ||
|
||
const app = new cdk.App(); | ||
|
||
new Stack(app, `mfng-ai-demo-preview`, { | ||
env: { | ||
account: process.env.CDK_DEFAULT_ACCOUNT, | ||
// A web ACL with CLOUDFRONT scope, and the certificate for CloudFront, must | ||
// both be created in the US East (N. Virginia) Region, us-east-1. | ||
region: `us-east-1`, | ||
}, | ||
bucketName: `mfng-ai-demo-preview-assets`, | ||
customDomain: { | ||
domainName: `strict.software`, | ||
subdomainName: `ai-demo-preview.mfng`, | ||
}, | ||
webAclName: `mfng-ai-demo-preview`, | ||
}); |
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