Skip to content

Commit

Permalink
update if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jogeorg committed Dec 23, 2024
1 parent 831c314 commit 48f5edf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ jobs:
echo "ARM_TENANT_ID=$(jq -r .tenantId <<< '${{ secrets.AZURE_CREDENTIALS }}')" >> $GITHUB_ENV
- name: Setup Terraform
if: ${{ env.new_release == 'true' }}
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.9.7

- name: Terraform Init
if: ${{ env.new_release == 'true' }} && success()
if: env.new_release == 'true' && success()
working-directory: src/terraform/mlz
run: |
terraform init \
Expand All @@ -99,27 +100,27 @@ jobs:
-backend-config="environment=usgovernment"
- name: Terraform Plan
if: ${{ env.new_release == 'true' }} && success()
if: env.new_release == 'true' && success()
working-directory: src/terraform/mlz
run: |
terraform plan --var "hub_subid=$ARM_SUBSCRIPTION_ID" -out=tfplan|| echo "Terraform Plan completed with non-zero exit code"
- name: Terraform Apply
if: ${{ env.new_release == 'true' }} && success()
if: env.new_release == 'true' && success()
working-directory: src/terraform/mlz
run: |
terraform apply -auto-approve tfplan
# TODO: Add a step to run the unit testing

- name: Terraform Destroy
if: ${{ env.new_release == 'true' }} && success()
if: env.new_release == 'true' && success()
working-directory: src/terraform/mlz
run: |
terraform destroy --var "hub_subid=$ARM_SUBSCRIPTION_ID" -auto-approve
- name: Commit changes and PR
if: ${{ env.new_release == 'true' }} && success()
if: env.new_release == 'true' && success()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit 48f5edf

Please sign in to comment.