Fixing the issue with the dynamo stack #15
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: CD | |
on: | |
push: | |
branches: | |
- dev | |
- prod | |
jobs: | |
Deploy_to_AWS: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
- name: Install CDK dependencies | |
run: | | |
echo "Installing CDK dependencies" | |
npm install -g aws-cdk | |
npm install | |
cd iac | |
npm install | |
- name: Install SRC dependencies | |
run: | | |
echo "Installing SRC dependencies" | |
cp -r src/core iac/src/ | |
- name: AWS Credentials | |
run: | | |
echo "Configuring AWS Credentials" | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set default.region ${{ secrets.AWS_REGION }} | |
aws configure set default.output json | |
- name: CDK Bootstrap | |
run: | | |
echo "CDK Bootstrap" | |
cd iac | |
aws cloudformation describe-stacks --stack-name CDKToolkit 2>&1 > /dev/null || \ | |
cdk bootstrap aws://${{ secrets.AWS_ACCOUNT_ID }}/${{ secrets.AWS_REGION }} | |
- name: CDK Deploy | |
run: | | |
echo "CDK Deploy" | |
cd iac | |
cdk deploy --require-approval never | |
env: | |
STAGE: ${{ github.ref_name }} | |
AZURE_URL: ${{ secrets.AZURE_URL }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |