Skip to content

Commit

Permalink
Limiting terraform runs to changes in tf folders
Browse files Browse the repository at this point in the history
  • Loading branch information
gitkvark committed Dec 29, 2023
1 parent 28f7752 commit 3d0a3ef
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/terraform_deployments_preprod_apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
paths:
- "deployments/preprod/**"
- ".github/workflows/terraform_deployments_preprod_apply.yaml"
workflow_dispatch:

env:
Expand Down Expand Up @@ -44,4 +47,4 @@ jobs:
id: apply
with:
run: ${{ steps.apply-run.outputs.run_id }}
comment: "Apply Run from GitHub Actions CI ${{ github.sha }}"
comment: "Apply Run from GitHub Actions CI ${{ github.sha }}"
5 changes: 4 additions & 1 deletion .github/workflows/terraform_deployments_preprod_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Terraform Deploying Preprod Plan"

on:
pull_request:
paths:
- "deployments/preprod/**"
- ".github/workflows/terraform_deployments_preprod_plan.yaml"
workflow_dispatch:

env:
Expand Down Expand Up @@ -79,4 +82,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: output
});
});
5 changes: 4 additions & 1 deletion .github/workflows/terraform_deployments_prod_apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
paths:
- "deployments/prod/**"
- ".github/workflows/terraform_deployments_prod_apply.yaml"
workflow_dispatch:

env:
Expand Down Expand Up @@ -36,4 +39,4 @@ jobs:
id: apply-run
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}
5 changes: 4 additions & 1 deletion .github/workflows/terraform_deployments_prod_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Terraform Deploying Prod Plan"

on:
pull_request:
paths:
- "deployments/prod/**"
- ".github/workflows/terraform_deployments_prod_plan.yaml"
workflow_dispatch:

env:
Expand Down Expand Up @@ -79,4 +82,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: output
});
});
3 changes: 3 additions & 0 deletions .github/workflows/terraform_provisioning_preprod_apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
paths:
- "provisioning/preprod/**"
- ".github/workflows/terraform_provisioning_preprod_apply.yaml"
workflow_dispatch:

env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/terraform_provisioning_preprod_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Terraform Provisioning Preprod Plan"

on:
pull_request:
paths:
- "provisioning-preprod/**"
- ".github/workflows/terraform_provisioning_preprod_plan.yaml"
workflow_dispatch:

env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/terraform_provisioning_prod_apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
paths:
- "provisioning/prod/**"
- ".github/workflows/terraform_provisioning_prod_apply.yaml"
workflow_dispatch:

env:
Expand Down Expand Up @@ -36,4 +39,4 @@ jobs:
id: apply-run
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}
3 changes: 3 additions & 0 deletions .github/workflows/terraform_provisioning_prod_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Terraform Provisioning Prod Plan"

on:
pull_request:
paths:
- "provisioning-prod/**"
- ".github/workflows/terraform_provisioning_prod_plan.yaml"
workflow_dispatch:

env:
Expand Down

0 comments on commit 3d0a3ef

Please sign in to comment.