Update CI readme #62
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: Deploy CI CloudFormation stack | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ci/** | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
strategy: | |
matrix: | |
include: | |
- region: us-east-1 | |
stack: infrastructure-ci | |
- region: us-west-2 | |
stack: infrastructure-ci | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- uses: aws-actions/setup-sam@v2 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::561178107736:role/DevOps-GitHubOidcFederatedRole | |
role-session-name: GitHubActions-DeployCiStack | |
- name: Deploy CloudFormation stack | |
working-directory: ci | |
run: | | |
bucket_name=$(aws cloudformation describe-stacks --region ${{ matrix.region }} --stack-name aws-sam-cli-managed-default | jq -r ".Stacks[0].Outputs[0].OutputValue") | |
sam deploy --region ${{ matrix.region }} --no-confirm-changeset --no-fail-on-empty-changeset --stack-name "${{ matrix.stack }}" --s3-bucket "$bucket_name" --s3-prefix "${{ matrix.stack }}" --capabilities CAPABILITY_IAM |