-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (31 loc) · 1.22 KB
/
terraform_plan.yaml
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
name: Plan terraform changes for base branch
on: [pull_request]
jobs:
plan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Plan production
if: success() && contains(github.base_ref, 'master')
env:
ENV: production
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_production }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_production }}
AWS_REGION: ${{ secrets.aws_region_production }}
run: ./scripts/infra plan -w ${{ github.base_ref }}
- name: Plan staging
if: success() && contains(github.base_ref, 'develop')
env:
ENV: staging
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_staging }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_staging }}
AWS_REGION: ${{ secrets.aws_region_staging }}
run: ./scripts/infra plan -w ${{ github.base_ref }}
- name: Plan dev
if: success() && (! contains(github.base_ref, 'master')) && (! contains(github.base_ref, 'develop'))
env:
ENV: dev
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_dev }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }}
AWS_REGION: ${{ secrets.aws_region_dev }}
run: ./scripts/infra plan -w ${{ github.base_ref }}