Skip to content

Commit

Permalink
PLT-271 Promotion workflows for opt-out-import (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsf authored Jan 18, 2024
1 parent f7a0bc0 commit f88876f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/opt-out-import-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:

- name: Upload and reload
run: |
aws s3 cp --no-progress optout/build/distributions/optout.zip s3://${{ vars.OPT_OUT_IMPORT_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-dev-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_BUCKET }} --s3-key function.zip
aws s3 cp --no-progress optout/build/distributions/optout.zip s3://${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-dev-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }} --s3-key function.zip
24 changes: 24 additions & 0 deletions .github/workflows/opt-out-import-deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy opt-out-import to prod

on:
workflow_dispatch:

env:
AWS_REGION: ${{ vars.AWS_REGION }}

jobs:
deploy:
runs-on: self-hosted
environment: prod

steps:
- name: Assume role in target account
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.ACCOUNT_ROLE }}

- name: Promote lambda code from test to prod
run: |
aws s3 cp --no-progress s3://${{ vars.OPT_OUT_IMPORT_TEST_ZIP_BUCKET }}/function.zip s3://${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-prod-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }} --s3-key function.zip
24 changes: 24 additions & 0 deletions .github/workflows/opt-out-import-deploy-sbx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy opt-out-import to sbx (sandbox)

on:
workflow_dispatch:

env:
AWS_REGION: ${{ vars.AWS_REGION }}

jobs:
deploy:
runs-on: self-hosted
environment: sbx

steps:
- name: Assume role in target account
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.ACCOUNT_ROLE }}

- name: Promote lambda code from test to sbx
run: |
aws s3 cp --no-progress s3://${{ vars.OPT_OUT_IMPORT_TEST_ZIP_BUCKET }}/function.zip s3://${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-sbx-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }} --s3-key function.zip
4 changes: 2 additions & 2 deletions .github/workflows/opt-out-import-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:

- name: Upload and reload
run: |
aws s3 cp --no-progress optout/build/distributions/optout.zip s3://${{ vars.OPT_OUT_IMPORT_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-test-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_BUCKET }} --s3-key function.zip
aws s3 cp --no-progress optout/build/distributions/optout.zip s3://${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }}/function.zip
aws lambda update-function-code --function-name ab2d-test-opt-out-import --s3-bucket ${{ vars.OPT_OUT_IMPORT_ZIP_BUCKET }} --s3-key function.zip

0 comments on commit f88876f

Please sign in to comment.