Skip to content

Commit b7f3215

Browse files
committed
chore: update prune resources to use reusable workflow.
1 parent 5cfb12b commit b7f3215

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

.github/workflows/prune-env.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,37 @@ on:
66
description: 'The name of the environment to destroy resources from dev or test or prod(BE CAREFUL HERE)'
77
required: true
88
default: 'dev'
9-
type: string
9+
type: choice
10+
options:
11+
- dev
12+
- test
1013
app_env:
1114
required: true
12-
type: string
15+
type: choice
1316
description: 'The APP env separates between AWS ENV and Actual APP, since AWS dev is where PR, and TEST is deployed'
17+
options:
18+
- dev
19+
- test
1420
permissions:
1521
id-token: write # This is required for requesting the JWT
1622
contents: write # This is required for actions/checkout
1723
packages: write
1824
jobs:
19-
cleanup-aws-database:
20-
name: Cleanup AWS Database
21-
uses: ./.github/workflows/.deployer.yml
25+
destroy-dev:
26+
name: Destroy Stack Dev
27+
if: ${{ github.event.inputs.app_env == 'dev' }}
28+
uses: ./.github/workflows/.deploy_stack.yml
2229
secrets: inherit
2330
with:
2431
environment_name: ${{ github.event.inputs.environment_name }}
2532
command: destroy
26-
working_directory: database
2733
app_env: ${{ github.event.inputs.app_env }}
28-
cleanup-aws-api:
29-
name: Cleanup AWS API
30-
uses: ./.github/workflows/.deployer.yml
31-
secrets: inherit
32-
with:
33-
environment_name: ${{ github.event.inputs.environment_name }}
34-
command: destroy
35-
working_directory: api
36-
app_env: ${{ github.event.inputs.app_env }}
37-
cleanup-aws-cf:
38-
name: Cleanup AWS CF
39-
uses: ./.github/workflows/.deployer.yml
40-
secrets: inherit
41-
with:
42-
environment_name: ${{ github.event.inputs.environment_name }}
43-
command: destroy
44-
working_directory: frontend
45-
app_env: ${{ github.event.inputs.app_env }}
34+
destroy-test:
35+
name: Destroy Stack Test
36+
if: ${{ github.event.inputs.app_env == 'test' }}
37+
uses: ./.github/workflows/.deploy_stack.yml
38+
secrets: inherit
39+
with:
40+
environment_name: ${{ github.event.inputs.environment_name }}
41+
command: destroy
42+
app_env: ${{ github.event.inputs.app_env }}

0 commit comments

Comments
 (0)