From ac1a6fa3d52bcf74493135dd8c81426180ec819a Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Sat, 7 Dec 2024 21:56:58 -0800 Subject: [PATCH] chore: trying --- .github/workflows/.deployer.yml | 7 ++++++- .github/workflows/pr-close.yml | 13 +++++++++++++ .github/workflows/pr-open.yml | 1 + .gitignore | 6 +++++- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pr-close.yml diff --git a/.github/workflows/.deployer.yml b/.github/workflows/.deployer.yml index c20cf5e0..c6d41c80 100644 --- a/.github/workflows/.deployer.yml +++ b/.github/workflows/.deployer.yml @@ -9,6 +9,11 @@ on: required: true default: 'dev' type: string + command: + description: 'The terragrunt command to run' + required: true + default: 'apply' + type: string @@ -48,4 +53,4 @@ jobs: aws_license_plate: ${{ secrets.AWS_LICENSE_PLATE }} run: | # Run terraform - terragrunt run-all apply --terragrunt-non-interactive \ No newline at end of file + terragrunt run-all ${{inputs.command}} --terragrunt-non-interactive \ No newline at end of file diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml new file mode 100644 index 00000000..e55a8768 --- /dev/null +++ b/.github/workflows/pr-close.yml @@ -0,0 +1,13 @@ +name: PR Close + +on: + pull_request: + types: [closed] +jobs: + cleanup-aws: + name: Cleanup AWS + uses: ./.github/workflows/.deployer.yml + with: + environment_name: dev + command: destroy + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index e8b4efc4..6e9113ec 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -34,6 +34,7 @@ jobs: uses: ./.github/workflows/.deployer.yml with: environment_name: dev + command: apply secrets: inherit diff --git a/.gitignore b/.gitignore index 4ab6b31c..d72c0a32 100644 --- a/.gitignore +++ b/.gitignore @@ -364,4 +364,8 @@ pyrightconfig.json .idea *.key *.pem -*.pub \ No newline at end of file +*.pub +**/node_modules +**/dist +# nested terragrunt-cache +**/.terragrunt-cache/** \ No newline at end of file