-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 979 Bytes
/
terraform.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: 'Deploy PPN with Terraform'
on:
push:
branches: [ "master" ]
pull_request:
permissions:
contents: read
jobs:
deploy_terraform:
name: Deploy with terraform
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v1
- name: Set up AWS credentials
run: |
mkdir -p ~/.aws
touch ~/.aws/credentials
echo "[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" > ~/.aws/credentials
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOY_AWS_TERRAFORM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOY_AWS_TERRAFORM_SECRET_ACCESS_KEY }}
- name: "intialize terraform"
run: terraform init
- name: "validate terraform"
run: terraform validate -no-color
- name: "Run terraform apply"
run: terraform apply -auto-approve -no-color