-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (52 loc) · 1.49 KB
/
deploy.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: deploy-pipeline
on:
push:
branches:
- "master"
jobs:
filters:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
aws-infra: ${{ steps.filter.outputs.aws-infra }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
aws-infra:
- 'aws-infra/**'
deploy-aws-infra:
runs-on: ubuntu-latest
needs: filters
if: needs.filters.outputs.aws-infra == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure AWS credentials for LitmusChaos Production
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.PROD_EKS_REGION }}
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false
- name: Terraform Version
run: terraform version
- name: Terraform Init
run: |
cd aws-infra/
terraform init
- name: Terraform Plan
run: |
cd aws-infra/
terraform plan
- name: Terraform Apply
run: |
cd aws-infra/
terraform apply -auto-approve