Skip to content

Deploy Infrastructure #96

Deploy Infrastructure

Deploy Infrastructure #96

Workflow file for this run

name: Deploy Infrastructure
on:
workflow_dispatch:
inputs:
env_name:
description: 'Environment: dev/prod'
required: true
env_region:
description: 'Region:'
required: true
jobs:
deploy-infra:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
ENV_NAME: unknown
ENV_REGION: unknown
steps:
- name: Set Env
run: |
echo "ENV_NAME=${{ github.event.inputs.env_name }}" >> $GITHUB_ENV
echo "ENV_REGION=${{ github.event.inputs.env_region }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ env.ENV_REGION }}
role-to-assume: arn:aws:iam::193347341732:role/GithubActionsRole
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
# Needs to be the same version as the execution environment of AWS Lambda, to make sure we download the correct dependencies
python-version: "3.10"
- name: Run Terraform
run: |
cd terraform/envs/${{ env.ENV_NAME }}
terraform init
terraform apply --auto-approve