-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 940 Bytes
/
terraform-apply.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
name: "Terraform Apply"
on:
pull_request:
types: [closed]
branches:
- main
paths:
- 'terraform/**'
- .github/workflows/terraform-apply.yaml
workflow_dispatch:
permissions: write-all
jobs:
apply:
runs-on: ubuntu-latest
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3.0.1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
- name: install terraform
uses: hashicorp/setup-terraform@v2
- name: checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: terraform init
run: terraform init
working-directory: terraform/environments/prod
- name: terraform apply
run: terraform apply -auto-approve
working-directory: terraform/environments/prod