Skip to content

Commit

Permalink
ajuste pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoclessa committed Jul 18, 2023
1 parent 52c291a commit 80cf4d5
Showing 1 changed file with 5 additions and 39 deletions.
44 changes: 5 additions & 39 deletions .github/workflows/terraform-destroy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,11 @@ on:
workflow_dispatch:

jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
- uses: actions/cache@v3
with:
path: |
.terraform/**
.terraform.lock.hcl
plan.cache
key: terraform-lock-${{ steps.extract_branch.outputs.branch }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY}}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY}}
aws-region: ${{ secrets.AWS_REGION }}
- name: Terraform Init
id: init
run: |
cat main.tf
terraform init
destroy:
runs-on: ubuntu-latest
needs: init
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
# with:
# terraform_version: 1.3.0
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
Expand All @@ -55,15 +26,10 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY}}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY}}
aws-region: ${{ secrets.AWS_REGION }}
# - name: Terraform Plan
# id: plan
# run: terraform plan -no-color -out plan.cache
# - name: encrypt cache
# run: zip --password "${{ secrets.ZIP_PASSWORD }}" plan.zip plan.cache
# - name: "Upload Artifact"
# uses: actions/upload-artifact@v2
# with:
# name: plan-cache
# path: plan.cache
- name: Terraform Init
id: init
run: |
cat main.tf
terraform init -reconfigure
- name: Terraform destroy
run: terraform destroy -auto-approve

0 comments on commit 80cf4d5

Please sign in to comment.