Skip to content

Deploy DR2 Ingest Lambdas #227

Deploy DR2 Ingest Lambdas

Deploy DR2 Ingest Lambdas #227

Workflow file for this run

name: Deploy DR2 Ingest Lambdas
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: 'Environment'
required: true
options:
- intg
- staging
- prod
default: 'intg'
to-deploy:
description: 'Version to deploy'
required: true
permissions:
id-token: write
contents: write
jobs:
deploy:
runs-on: ubuntu-22.04
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
- id: role-name
run: |
import os
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f"role-name={'${{ github.event.inputs.environment }}'.title()}DPGithubActionsDeployLambdaRole", file=fh)
shell: python
- name: Configure AWS credentials for Lambda
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_NUMBER }}:role/${{ steps.role-name.outputs.role-name }}
aws-region: eu-west-2
role-session-name: ECRLogin
- run: |
pip install boto3
git branch -f release-${{ github.event.inputs.environment }} HEAD
git push -f origin release-${{ github.event.inputs.environment }}
python .github/scripts/deploy.py ${{ github.event.inputs.environment }} ${{ github.event.inputs.to-deploy }}