Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Committing changes to the repository #7

Committing changes to the repository

Committing changes to the repository #7

Workflow file for this run

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: 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
npm run build
cdk deploy --require-approval never
env:
OWNER: ${{ vars.OWNER }}
STAGE: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_AUTHORITY_URL: ${{ secrets.AZURE_AUTHORITY_URL }}
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 }}