Skip to content

Commit

Permalink
create destroy plan
Browse files Browse the repository at this point in the history
  • Loading branch information
italopessoa committed Sep 23, 2024
1 parent b18d9be commit 75f59ef
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ jobs:
body: output
});
terraform-apply:
deploy:
if: github.ref == 'refs/heads/main'
needs: [test]
name: "Terraform Apply"
runs-on: ubuntu-latest
environment: dev
permissions:
contents: read
outputs:
CONFIG_VERSION: ${{ steps.apply-upload.outputs.configuration_version_id }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -173,4 +175,19 @@ jobs:
id: apply
with:
run: ${{ steps.apply-run.outputs.run_id }}
comment: "Confirmed from GitHub Actions CI ${{ github.sha }}"
comment: "Confirmed from GitHub Actions CI ${{ github.sha }}"

destroy-plan:
name: "Create terraform destroy plan"
needs: [deploy]
runs-on: ubuntu-latest

steps:
- name: Create plan
uses: hashicorp/tfc-workflows-github/actions/[email protected]
id: destroy-plan
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ needs.deploy.outputs.CONFIG_VERSION }}
is_destroy: true

0 comments on commit 75f59ef

Please sign in to comment.