Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NH-90728: update workflow for both stg and prod lambda #154

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/build_publish_lambda_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ on:
- RubyGem
- Local

publish-dest:
required: true
description: 'Publish destination, one of: staging, production'
type: choice
default: 'staging'
options:
- staging
- production

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
Expand All @@ -24,7 +33,6 @@ jobs:
# act -j build_layer --container-architecture linux/arm64
build_layer:
strategy:
fail-fast: false
matrix:
arch:
- x86_64
Expand Down Expand Up @@ -63,19 +71,40 @@ jobs:
- build_layer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
aws_region:
- ap-northeast-1
- ap-northeast-2
- ap-south-1
- ap-southeast-1
- ap-southeast-2
- ca-central-1
- eu-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
arch:
- x86_64
- arm64
steps:
- uses: actions/checkout@v4

- uses: aws-actions/configure-aws-credentials@v4
- if: ${{ inputs.publish-dest == 'staging' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.LAMBDA_PUBLISHER_ARN_STAGING }}
aws-region: ${{ matrix.aws_region }}

- if: ${{ inputs.publish-dest == 'production' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.LAMBDA_PUBLISHER_ARN }}
role-to-assume: ${{ secrets.LAMBDA_PUBLISHER_ARN_PROD }}
aws-region: ${{ matrix.aws_region }}

- name: extract layer zip from artifacts
Expand Down
Loading