Integrate with actions (#1)
Co-authored-by: Ben Martin <ben.martin@sky.uk> Reviewed-on: #1
This commit is contained in:
parent
d4335ca10e
commit
cba0f1cfd4
6 changed files with 109 additions and 18 deletions
|
@ -1,21 +1,23 @@
|
|||
name: Deploy
|
||||
name: Terraform Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_run:
|
||||
workflows: ["Terraform Plan"]
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
TF_IN_AUTOMATION: true
|
||||
TF_CLI_ARGS: "-no-color"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
plan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Terraform Init
|
||||
run: |
|
||||
terraform init -input=false
|
||||
- name: Terraform Plan
|
||||
run: |
|
||||
terraform plan -out=tfplan -input=false
|
||||
- name: Terraform Apply
|
||||
run: |
|
||||
terraform apply -input=false tfplan
|
||||
- uses: actions/checkout@v4
|
||||
- uses: hashicorp/setup-terraform@v3
|
||||
- name: Terraform apply
|
||||
id: apply
|
||||
run: terraform apply -auto-approve tfplan
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue