File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Terraform Deploy
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' **.tf'
8+ - ' **.tfvars'
9+ - ' .github/workflows/terraform-deploy.yml'
10+
11+ jobs :
12+ deploy :
13+ name : Terraform Apply
14+ runs-on : ubuntu-latest
15+ environment : production
16+
17+ env :
18+ AWS_REGION : eu-west-1
19+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
20+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+
22+ steps :
23+ - name : Checkout code
24+ uses : actions/checkout@v4
25+
26+ - name : Setup Terraform
27+ uses : hashicorp/setup-terraform@v3
28+ with :
29+ terraform_version : 1.5.7
30+
31+ - name : Terraform Init
32+ run : terraform init
33+
34+ - name : Terraform Plan
35+ id : plan
36+ run : terraform plan -out=tfplan -no-color
37+
38+ - name : Terraform Apply
39+ run : terraform apply -auto-approve tfplan
40+
41+ - name : Output Results
42+ if : always()
43+ run : terraform output -json
Original file line number Diff line number Diff line change 11name : Terraform Tests
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [main]
67 paths :
You can’t perform that action at this time.
0 commit comments