-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.17 KB
/
reporting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build reporting infrastructure
on:
push:
branches: [ main ]
paths:
- 'reports/**'
- .github/workflows/**
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_github_sha: $GITHUB_SHA
TF_VAR_db_password: ${{ secrets.DB_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v3
- run: |
cd aws
terraform init
terraform plan
terraform apply -auto-approve