Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tf deplotment changes #17093

Merged
merged 6 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions .github/workflows/cleanup_acr_images.yml

This file was deleted.

54 changes: 36 additions & 18 deletions .github/workflows/deploy_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,48 @@ jobs:
sp-creds: ${{ env.AZURE_CREDENTIALS }}
tf-auth: true
- name: Collect Terraform stats

uses: josiahsiegel/terraform-stats@68b8cbe42c494333fbf6f8d90ac86da1fb69dcc2
## DevSecOps - Aquia (Replace) - uses: ./.github/actions/terraform-stats

uses: ./.github/actions/terraform-stats
id: stats1
with:
terraform-directory: operations/app/terraform/vars/${{ needs.pre_job.outputs.env_name }}
terraform-version: 1.7.4
add-args: "-refresh=false"

approve_deploy:
name: Approve Deploy - ${{ needs.pre_job.outputs.env_name }}
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
needs:
- pre_job
- confirm_changes
if: needs.confirm_changes.outputs.change_count > '0'
runs-on: ubuntu-latest
environment: ${{ needs.pre_job.outputs.env_name }}_terraform
steps:
- name: Echo change count
run: echo ${{ needs.confirm_changes.outputs.change_count }}
- name: Terraform Format
# fails on formatting issues, fix locally with `tf fmt -recursive` and push again if this step fails
run: terraform fmt -check -recursive

- name: "Terraform init"
run: terraform init -input=false

- name: "Terraform validate"
run: terraform validate

- name: Terraform Plan
run: |
terraform plan -out=tf.plan -input=false -no-color -lock-timeout=600s

- name: Comment Plan on PR
uses: blinqas/tf-plan-pr-comment@v1
with:
output_file: ${{ github.workspace }}/plan_output.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

approve_deploy:
name: Approve Deploy - ${{ needs.pre_job.outputs.env_name }}
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
needs:
- pre_job
- confirm_changes
if: needs.confirm_changes.outputs.change_count > '0'
runs-on: ubuntu-latest
environment: ${{ needs.pre_job.outputs.env_name }}_terraform
steps:
- name: Echo change count
run: echo ${{ needs.confirm_changes.outputs.change_count }}

run_deploy:
name: Run Deploy - ${{ needs.pre_job.outputs.env_name }}
Expand Down
Loading