Added Example #9
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
name: CDK Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["master"] | |
jobs: | |
aws_cdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm install | |
- name: Install AWS CDK | |
run: npm i -g aws-cdk | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@master | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
aws-region: ${{ secrets.AWS_REGION || 'us-east-1'}} | |
- name: Bootstrap CDK | |
run: cdk bootstrap | |
- name: Synth stack | |
run: cdk synth | |
- name: Deploy stack | |
run: cdk deploy --all --require-approval never |