Skip to content

juridical-infra-destroy #31

juridical-infra-destroy

juridical-infra-destroy #31

name: juridical-infra-destroy
on:
workflow_dispatch:
defaults:
run:
working-directory: infra
env:
TERRAFORM_CREDENTIALS: ${{ secrets.TERRAFORM_CREDENTIALS }}
JURIDICAL_SERVICE_ACCOUNT: ${{ secrets.JURIDICAL_SERVICE_ACCOUNT }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: hashicorp/setup-terraform@v2
- name: Init
working-directory: infra
run: terraform init
env:
GOOGLE_CREDENTIALS: ${{ env.TERRAFORM_CREDENTIALS }}
- name: Validate
working-directory: infra
run: terraform validate
env:
GOOGLE_CREDENTIALS: ${{ env.TERRAFORM_CREDENTIALS }}
- name: Destroy
working-directory: infra
run: |-
terraform destroy \
-var="project_id=${{ env.PROJECT_ID }}" \
-var="service_account=${{ env.JURIDICAL_SERVICE_ACCOUNT }}" \
-auto-approve
env:
GOOGLE_CREDENTIALS: ${{ env.TERRAFORM_CREDENTIALS }}