WF updates #23
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: Deploy CDK Stack | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
cache: maven | |
- name: Set up Node we can install CDK | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- name: Install CDK | |
run: npm install -g aws-cdk | |
- name: Setup AWS Creds | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-central-1 | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
mask-aws-account-id: true | |
- name: Ensure CDK is bootstraped | |
run: | | |
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | |
cdk bootstrap --ci=true aws://${ACCOUNT_ID}/eu-central-1 -c accountId=${ACCOUNT_ID} | |
- name: Deploy Stack with CDK | |
run: | | |
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | |
# deploy a stack to Frankfurt to validate everything (just to keep us-east-1 and us-west-2 cleaner) | |
cdk deploy -c accountId=${ACCOUNT_ID} -c stackName=chime-cdk-github-action -c regionEast=eu-central-1 --require-approval=never --ci=true east | |
env: | |
# Set this to bogus IP just so VoiceConnector Origination settings are deployed to validate that works | |
PBX_HOSTNAME: 10.0.0.1 |