-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (43 loc) · 1.39 KB
/
deployment_destroy_api_gateway_and_cognito.yml
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
50
name: deployment-destroy-api-gateway-and-cognito
on:
workflow_dispatch:
branches: [ main ]
permissions:
id-token: write # required to use OIDC authentication
contents: read # required to checkout the code from the repo
jobs:
build:
runs-on: ubuntu-latest
steps:
## Check Terraform formatting
- name: Terraform Format
working-directory: ./terraform-api-gateway-cognito
id: fmt
run: terraform fmt -check
## Init Terraform
- name: Terraform Init
working-directory: ./terraform-api-gateway-cognito
id: init
run: terraform init
## Validate Terraform
- name: Terraform Validate
working-directory: ./terraform-api-gateway-cognito
id: validate
run: terraform validate -no-color
## Plan Terraform
- name: Terraform Plan
working-directory: ./terraform-api-gateway-cognito
id: plan
run: terraform plan -no-color
continue-on-error: true
## Fail the job if terraform plan doesn't succeed
- name: Terraform Plan Status
working-directory: ./terraform-api-gateway-cognito
id: plan_status
if: steps.plan.outcome == 'failure'
run: exit 1
## Destroy Terraform
- name: Terraform Destroy
working-directory: ./terraform-api-gateway-cognito
id: destroy
run: terraform destroy -auto-approve