Merge pull request #1 from nulib/5400-deploy-action #8
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 changes to Amplify | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
invoke-lambda: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # 🔹 REQUIRED for OIDC authentication | |
contents: read | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
# role name must match the name in the UI Construct of the CDK code | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/staging-OSDP-Prototype-UIBuildFunctionInvokerRole | |
- name: Invoke Lambda | |
run: | | |
aws lambda invoke \ | |
--function-name ${{ secrets.LAMBDA_ARN }} \ | |
--payload '{"AMPLIFY_BRANCH_NAME": "'"${{ github.head_ref || github.ref_name }}"'"}' \ | |
--cli-binary-format raw-in-base64-out \ | |
--cli-read-timeout 360 \ | |
--cli-connect-timeout 360 \ | |
response.json | |
cat response.json |