grant SES to lambda role #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: Build reporting infrastructure | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'reports/**' | |
- .github/workflows/reporting.yml | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 663234259711.dkr.ecr.us-east-1.amazonaws.com | |
- run: docker build -t "663234259711.dkr.ecr.us-east-1.amazonaws.com/hotkey/reporting:${GITHUB_SHA}" ./reports | |
- run: docker push "663234259711.dkr.ecr.us-east-1.amazonaws.com/hotkey/reporting:${GITHUB_SHA}" | |
terraform: | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_db_password: ${{ secrets.DB_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hashicorp/setup-terraform@v3 | |
- run: | | |
cd aws | |
terraform init | |
terraform plan -var "github_sha=$GITHUB_SHA" | |
terraform apply -var "github_sha=$GITHUB_SHA" -auto-approve |