11# .github/workflows/terraform-dev
2- name : ' Deploy Feature Branch to Sandbox'
2+ name : " Deploy Feature Branch to Sandbox"
33
44on :
55 workflow_dispatch :
66 inputs :
77 buildBranch :
8- description : ' Feature branch to push to sandbox.'
8+ description : " Feature branch to push to sandbox."
99 required : true
10- type : ' string'
10+ type : " string"
1111 sandboxWorkspace :
12- description : ' Which Sandbox to push to.'
12+ description : " Which Sandbox to push to."
1313 required : true
14- type : ' string'
14+ type : " string"
1515 environment :
16- default : ' development'
17- description : ' Which environment should this run against'
16+ default : " development"
17+ description : " Which environment should this run against"
1818 required : true
19- type : ' string'
19+ type : " string"
2020
2121permissions :
2222 pull-requests : write
@@ -30,10 +30,10 @@ jobs:
3030
3131 steps :
3232 # Checkout the repository to the GitHub Actions runner
33- - name : Checkout
33+ - name : Checkout Base
3434 uses : actions/checkout@v4
3535 with :
36- ref : ${{ github.event.inputs.buildBranch}}
36+ ref : main
3737
3838 - name : Configure AWS Credentials
3939 uses : aws-actions/configure-aws-credentials@v4
5353 terraform_version : 1.11.4
5454 terraform_wrapper : false
5555
56- - name : Terraform Init
56+ - name : Terraform Init Base
5757 id : init
5858 run : terraform init -backend-config=backend.conf
5959 working-directory : ./infrastructure
6565 working-directory : ./infrastructure
6666 shell : bash
6767
68+ - name : Terraform Plan Base
69+ id : plan
70+ run : |
71+ terraform plan -input=false -no-color -var-file="${{vars.TF_VARS_FILE}}" -out tf.plan
72+ working-directory : ./infrastructure
73+ shell : bash
74+
75+ - name : Terraform Apply Base
76+ run : terraform apply -auto-approve -input=false tf.plan
77+ working-directory : ./infrastructure
78+
79+ - name : Checkout
80+ uses : actions/checkout@v4
81+ with :
82+ ref : ${{ github.event.inputs.buildBranch}}
83+
6884 # Checks that all Terraform configuration files adhere to a canonical format
6985 - name : Terraform Format
7086 run : terraform fmt -check
0 commit comments