Skip to content

WF tweaks

WF tweaks #30

Workflow file for this run

name: Deploy CDK Stack
on:
push:
branches: [ "main" ]
env:
# Region to deploy
REGION: eu-central-1
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
id: aws-creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
mask-aws-account-id: true
- name: Add AWS_ACCOUNT_ID to Environment
run: echo "AWS_ACCOUNT_ID=${{ steps.aws-creds.outputs.aws-account-id }}" >> $GITHUB_ENV
- name: Ensure CDK is bootstraped and up to date
run: |
cdk bootstrap --ci=true -c accountId=${AWS_ACCOUNT_ID} aws://${AWS_ACCOUNT_ID}/${REGION}
- name: Deploy Stack with CDK
run: |
# deploy a stack to Frankfurt to validate everything (just to keep us-east-1 and us-west-2 cleaner)
# Also you are limited to 3 Voice Connectors per region
cdk deploy -c accountId=${AWS_ACCOUNT_ID} -c stackName=chime-cdk-github-action -c regionEast=${REGION} --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