-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.27 KB
/
aws_docker_destroy_infrastructure.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
name: Destroy infrastructure (AWS, Docker Compose)
on:
workflow_dispatch:
jobs:
deploy-infra:
runs-on: ubuntu-latest
continue-on-error: False
name: Destroy infrastructure (AWS, Docker Compose)
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Store SSH public and private keys
env:
PRIVATE_KEY: ${{ secrets.OPERATOR_SSH_PRIVATE_KEY }}
run: |
./scripts/store_public_private_keys.sh
- name: Set up Terraform Version
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.6
terraform_wrapper: false
- name: Terraform Init
run: |
cd infra/aws/docker-compose
terraform init -backend-config="bucket=${{ vars.TFSTATE_S3_BUCKET }}"
- name: Terraform Plan
run: |
cd infra/aws/docker-compose
terraform plan
- name: Terraform Destroy
run: |
cd infra/aws/docker-compose
terraform destroy -auto-approve