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
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
AWS_REGION: "us-east-1" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
AssumeRoleAndCDKDeploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
cache: "npm" | |
- name: Configure AWS credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: arn:aws:iam::533266994320:role/administrator | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Set AWS account ID | |
run: echo "AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)" >> $GITHUB_ENV | |
- name: Sts GetCallerIdentity | |
run: aws sts get-caller-identity | |
- name: Build Blog | |
run: | | |
npm install --frozen-lockfile | |
npm run build | |
- name: List contents of doc_build | |
run: ls -R ./doc_build | |
- name: Build and prepare services | |
run: | | |
cd ./services/common | |
make executable | |
make install | |
make build | |
make bundle | |
make zip | |
- name: install build and deploy cdk | |
run: | | |
cd ./cdk | |
npm install --frozen-lockfile | |
npm run build | |
npx cdk bootstrap aws://$AWS_ACCOUNT_ID/$AWS_REGION | |
npx cdk deploy --all --require-approval never | |
env: | |
AWS_REGION: ${{ env.AWS_REGION }} | |
AWS_ACCOUNT_ID: ${{ env.AWS_ACCOUNT_ID }} |