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
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        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 us-east-1 --stack-name aws-sam-cli-managed-default | jq -r ".Stacks[0].Outputs[0].OutputValue")
          stack_name="infrastructure-ci"
          sam deploy --region us-east-1 --no-confirm-changeset --no-fail-on-empty-changeset --stack-name "$stack_name" --s3-bucket "$bucket_name" --s3-prefix "$stack_name" --capabilities CAPABILITY_IAM

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@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        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

Update CI deploy workflow for multi-region
Update CI deploy workflow for multi-region
