-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1012 Bytes
/
deploy.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
37
38
39
40
name: Deploy
on:
push:
paths:
- 'terraform/**'
branches:
main
jobs:
Terraform:
name: Terraform Plan & Apply
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Terraform Setup
uses: hashicorp/setup-terraform@v1
- name: Terraform Init
run: terraform init
working-directory: 'terraform/aws'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_TERRAFORM_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_TERRAFORM_SECRET_KEY }}
- name: Terraform Validate
run: terraform validate
working-directory: 'terraform/aws'
- name: Terraform Apply
run: terraform apply -auto-approve
working-directory: 'terraform/aws'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_TERRAFORM_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_TERRAFORM_SECRET_KEY }}