-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (53 loc) · 1.95 KB
/
dev-destroy.yaml
File metadata and controls
68 lines (53 loc) · 1.95 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Destroy DEV env
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
env:
AWS_ROLE: 'arn:aws:iam::831947081981:role/JworksTechBlogGithubRole'
jobs:
destroy:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: repository-token
with:
app-id: ${{ vars.ORDINA_GROUP_BOT_APP_ID }}
private-key: ${{ secrets.ORDINA_GROUP_BOT_CERT }}
owner: ${{ github.repository_owner }}
repositories: "jworks-terraform-modules"
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup git creds
run: git config --global url."https://${{ vars.ORDINA_GROUP_BOT_APP_ID }}:${{ steps.repository-token.outputs.token }}@github".insteadOf https://github
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
role-to-assume: ${{ env.AWS_ROLE }}
aws-region: eu-west-1
- name: Remove files from s3
run: aws s3 rm --recursive s3://blog.tst.ordina-jworks.io
- name: Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
- name: Terraform Init
id: init
run: terraform init
working-directory: infra/env/dev
- name: Terraform Format
id: fmt
run: terraform fmt -check
working-directory: infra/env/dev
- name: Terraform Validate
id: validate
run: terraform validate -no-color
working-directory: infra/env/dev
- name: Terraform Plan Destroy
id: plan-destroy
run: terraform plan
working-directory: infra/env/dev
- name: Terraform Destroy
id: destroy
run: terraform destroy -auto-approve
working-directory: infra/env/dev