Skip to content

Commit e07c482

Browse files
committed
chore: update deployment workflow to support pull requests and configure AWS credentials
- Added support for pull request triggers in the deployment workflow for specific paths. - Configured AWS credentials using a role to assume, enhancing security. - Updated the AWS region to 'us-west-2' and removed hardcoded access keys.
1 parent 9907003 commit e07c482

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Diff for: .github/workflows/deploy.yaml

+17-11
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,31 @@ name: Deployment
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- "lib/**"
8+
- "integration_tests/**"
9+
- "package.json"
10+
- "package-lock.json"
511

612
jobs:
713
build_package_and_deploy:
814
name: Build, package and deploy
915
runs-on: ubuntu-latest
1016
timeout-minutes: 90
17+
permissions:
18+
id-token: write
19+
contents: read
1120
env:
12-
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION_DEPLOY }}
13-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEPLOY }}
14-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEPLOY }}
15-
AWS_DEFAULT_ACCOUNT: ${{ secrets.AWS_ACCOUNT_ID }}
21+
AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }}
22+
AWS_DEFAULT_REGION: 'us-west-2'
1623
steps:
24+
- name: Configure AWS credentials
25+
uses: aws-actions/configure-aws-credentials@v4
26+
with:
27+
role-to-assume: ${{ env.AWS_ROLE_ARN }}
28+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
29+
1730
- uses: actions/checkout@v4
1831

1932
- uses: actions/setup-node@v4
@@ -30,7 +43,6 @@ jobs:
3043
- name: Generate distribution packages
3144
run: npm run package
3245

33-
3446
- name: Install deployment environment
3547
id: install_deploy_env
3648
run: |
@@ -56,12 +68,6 @@ jobs:
5668
PROJECT_ID: ${{ steps.short-sha.outputs.sha }}
5769
run: |
5870
source .deployment_venv/bin/activate
59-
60-
# synthesize the stack
61-
cd integration_tests/cdk
62-
npx cdk synth --debug --all --require-approval never
63-
64-
# deploy the stack
6571
npx cdk deploy --ci --all --require-approval never
6672
deactivate
6773
cd -

0 commit comments

Comments
 (0)