Skip to content

Commit 804a433

Browse files
authored
Update aws-destroy.yml
1 parent 3858a43 commit 804a433

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

.github/workflows/aws-destroy.yml

-75
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,9 @@ on:
88

99
jobs:
1010

11-
terraform_nap:
12-
name: "NGINX App Protect"
13-
runs-on: ubuntu-latest
14-
defaults:
15-
run:
16-
working-directory: ./nap
17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v3
20-
21-
- name: Setup Terraform
22-
uses: hashicorp/setup-terraform@v2
23-
with:
24-
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
25-
26-
- name: Setup Terraform Backend
27-
id: backend
28-
run: |
29-
cat > backend.tf << EOF
30-
terraform {
31-
cloud {
32-
organization = "${{ secrets.TF_CLOUD_ORGANIZATION }}"
33-
workspaces {
34-
name = "${{ secrets.TF_CLOUD_WORKSPACE_NAP }}"
35-
}
36-
}
37-
}
38-
EOF
39-
echo ${{secrets.NGINX_JWT}} | base64 -d > nginx-repo.jwt
40-
- name: Terraform Init
41-
id: init
42-
run: terraform init
43-
44-
- name: Terraform Validate
45-
id: validate
46-
run: terraform validate -no-color
47-
48-
- name: Terraform Plan
49-
id: plan
50-
if: github.event_name == 'pull_request'
51-
run: terraform plan -no-color -input=false
52-
continue-on-error: true
53-
54-
- uses: actions/github-script@v6
55-
if: github.event_name == 'pull_request'
56-
env:
57-
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
58-
with:
59-
github-token: ${{ secrets.GITHUB_TOKEN }}
60-
script: |
61-
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
62-
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
63-
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
64-
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
65-
<details><summary>Show Plan</summary>
66-
\`\`\`\n
67-
${process.env.PLAN}
68-
\`\`\`
69-
</details>
70-
*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
71-
github.rest.issues.createComment({
72-
issue_number: context.issue.number,
73-
owner: context.repo.owner,
74-
repo: context.repo.repo,
75-
body: output
76-
})
77-
- name: Terraform Plan Status
78-
if: steps.plan.outcome == 'failure'
79-
run: exit 1
80-
81-
- name: Terraform Destroy
82-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
83-
run: terraform destroy -auto-approve -input=false
84-
8511
terraform_eks:
8612
name: "AWS EKS"
8713
runs-on: ubuntu-latest
88-
needs: terraform_nap
8914
defaults:
9015
run:
9116
working-directory: ./eks-cluster

0 commit comments

Comments
 (0)