Merge pull request #162 from ModusCreateOrg/ADE-200-Adam #99
This file contains hidden or 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 to Development | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
cd backend | |
npm ci | |
- name: Run unit tests | |
run: | | |
cd backend | |
npm test | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::841162674562:role/GitHubAction-AssumeRoleWithAction | |
aws-region: us-east-1 | |
role-session-name: GithubActionsDeployment | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
cd backend | |
npm ci | |
- name: Install latest AWS CDK | |
run: npm install -g aws-cdk | |
- name: Build application | |
run: | | |
cd backend | |
npm run build | |
- name: Deploy to AWS | |
run: | | |
cd backend | |
npm run cdk deploy ai-team-medical-reports-stack-development -- \ | |
--require-approval never \ | |
--context environment=development | |
env: | |
CDK_DEFAULT_ACCOUNT: ${{ secrets.AWS_ACCOUNT_ID }} | |
CDK_DEFAULT_REGION: us-east-1 |