Skip to content

Commit

Permalink
Merge pull request #21 from soat-fiap/destroy_plan
Browse files Browse the repository at this point in the history
create destroy plan
  • Loading branch information
italopessoa authored Sep 23, 2024
2 parents 5fe199d + 75f59ef commit 8e29376
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 8e29376

Please sign in to comment.