Merge apply with plan

This commit is contained in:
Ben Martin 2024-06-04 00:25:26 +01:00
parent 0a1960a891
commit 68fc0dc1e0
No known key found for this signature in database
GPG key ID: 11936493893207E4
2 changed files with 11 additions and 24 deletions

View file

@ -1,23 +0,0 @@
name: Terraform Deploy
on:
workflow_run:
workflows: ["plan.yaml"]
types:
- completed
branches:
- main
env:
TF_IN_AUTOMATION: true
TF_CLI_ARGS: "-no-color"
jobs:
apply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Terraform apply
id: apply
run: terraform apply -auto-approve tfplan

View file

@ -1,4 +1,4 @@
name: Terraform Plan name: Terraform Plan and Apply
on: on:
pull_request: pull_request:
@ -87,3 +87,13 @@ jobs:
body: output body: output
}) })
} }
apply:
runs-on: ubuntu-latest
needs: plan
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Terraform apply
id: apply
run: terraform apply -auto-approve tfplan