-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.88 KB
/
terraform_destroy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Terraform Destroy - Destroy all environment
on: [workflow_dispatch]
env:
TF_VAR_GOOGLE_CLOUD_PROJECT_ID: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
TF_VAR_VM_ZONES: ${{ secrets.VM_ZONES }}
TF_VAR_VM_NAME_PREFIX: ${{ secrets.VM_NAME_PREFIX }}
TF_VAR_ORCHESTRATOR_VM_INSTALL_SH_FILE_PATH: "/../install_prerequisites-gc-orchestrator-vm.sh"
TF_VAR_GPU_VM_INSTALL_SH_FILE_PATH: "/../install_prerequisites-gc-gpu-vm.sh"
TF_VAR_DOMAIN_NAME: ${{ secrets.DOMAIN_NAME }}
TF_VAR_ACME_OWNER_EMAIL: ${{ secrets.ACME_OWNER_EMAIL }}
TF_VAR_ORCHESTRATOR_CONTAINER_NAME: ${{ secrets.ORCHESTRATOR_CONTAINER_NAME }}
TF_VAR_PIXEL_STREAMING_UNREAL_CONTAINER_IMAGE_NAME: ${{ secrets.PIXEL_STREAMING_UNREAL_CONTAINER_IMAGE_NAME }}
TF_VAR_GPU_INSTANCES_PER_ZONE: ${{ secrets.GPU_INSTANCES_PER_ZONE }}
TF_VAR_MAX_USER_SESSION_PER_INSTANCE: ${{ secrets.MAX_USER_SESSION_PER_INSTANCE }}
TF_VAR_GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
jobs:
terraform-destroy:
name: Terraform Destroy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
# Setup terraform env.
- name: HashiCorp - Setup Terraform
uses: hashicorp/[email protected]
with:
terraform_version: 1.1.7
- name: Terraform Init
working-directory: terraform
id: init
run: terraform init -backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}" -backend-config="prefix=terraform/state-${{ secrets.VM_NAME_PREFIX }}"
- name: Terraform Destroy Plan
working-directory: terraform
id: plan
run: terraform plan -destroy -input=false
- name: Terraform Destroy Apply
working-directory: terraform
id: apply
run: terraform apply -destroy -auto-approve -input=false