-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add app context for removal * Add CDK deployment to dev env
- Loading branch information
1 parent
b070e28
commit d2d5e04
Showing
2 changed files
with
186 additions
and
3 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,173 @@ | ||
name: Deploy CDK to DEV | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
actions: read | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
deploy-zip-lambdas-cdk: | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
environment: ["dev"] | ||
runs-on: ubuntu-22.04 | ||
environment: | ||
name: ${{ matrix.environment }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | ||
aws-region: us-east-1 | ||
|
||
- name: Deploy ZIP-based Lambdas | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
CDK_DEBUG: true | ||
run: | | ||
pushd cdk-eregs | ||
npm install -g aws-cdk@latest @aws-sdk/client-ssm | ||
npm install | ||
# Get exact stack names | ||
REDIRECT_STACK="cms-eregs-${{ matrix.environment }}-redirect-api" | ||
MAINTENANCE_STACK="cms-eregs-${{ matrix.environment }}-maintenance-api" | ||
cdk deploy ${REDIRECT_STACK} ${MAINTENANCE_STACK} \ | ||
-c environment=${{ matrix.environment }} \ | ||
--require-approval never \ | ||
--exclusively \ | ||
--app "npx ts-node bin/zip-lambdas.ts" | ||
popd | ||
deploy-text-extractor-cdk: | ||
needs: deploy-zip-lambdas-cdk | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
environment: ["dev"] | ||
runs-on: ubuntu-22.04 | ||
environment: | ||
name: ${{ matrix.environment }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | ||
aws-region: us-east-1 | ||
|
||
- name: Deploy Text Extractor | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
CDK_DEBUG: true | ||
run: | | ||
pushd cdk-eregs | ||
npm install -g aws-cdk@latest @aws-sdk/client-ssm | ||
npm install | ||
TEXT_EXTRACTOR_STACK="cms-eregs-${{ matrix.environment }}-text-extractor" | ||
cdk deploy $TEXT_EXTRACTOR_STACK \ | ||
-c environment=${{ matrix.environment }} \ | ||
--require-approval never \ | ||
--exclusively \ | ||
--app "npx ts-node bin/docker-lambdas.ts" | ||
popd | ||
deploy-fr-parser-cdk: | ||
needs: [deploy-zip-lambdas-cdk, deploy-text-extractor-cdk] | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
environment: ["dev"] | ||
runs-on: ubuntu-22.04 | ||
environment: | ||
name: ${{ matrix.environment }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | ||
aws-region: us-east-1 | ||
|
||
- name: Deploy FR Parser | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
CDK_DEBUG: true | ||
run: | | ||
pushd cdk-eregs | ||
npm install -g aws-cdk@latest @aws-sdk/client-ssm | ||
npm install | ||
FR_PARSER_STACK="cms-eregs-${{ matrix.environment }}-fr-parser" | ||
cdk deploy $FR_PARSER_STACK \ | ||
-c environment=${{ matrix.environment }} \ | ||
--require-approval never \ | ||
--exclusively \ | ||
--app "npx ts-node bin/docker-lambdas.ts" | ||
popd | ||
deploy-ecfr-parser-cdk: | ||
needs: [deploy-zip-lambdas-cdk, deploy-text-extractor-cdk, deploy-fr-parser-cdk] | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
environment: ["dev"] | ||
runs-on: ubuntu-22.04 | ||
environment: | ||
name: ${{ matrix.environment }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | ||
aws-region: us-east-1 | ||
|
||
- name: Deploy ECFR Parser | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
CDK_DEBUG: true | ||
run: | | ||
pushd cdk-eregs | ||
npm install -g aws-cdk@latest @aws-sdk/client-ssm | ||
npm install | ||
ECFR_PARSER_STACK="cms-eregs-${{ matrix.environment }}-ecfr-parser" | ||
cdk deploy $ECFR_PARSER_STACK \ | ||
-c environment=${{ matrix.environment }} \ | ||
--require-approval never \ | ||
--exclusively \ | ||
--app "npx ts-node bin/docker-lambdas.ts" | ||
popd |
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