5959 - name : Generate environment-specific Terraform variables file
6060 run : |
6161 # Create environment-specific tfvars file
62- cat > deploy/terraform/${{ github.event.inputs.environment || inputs.environment || 'staging' }}.tfvars << EOF
62+ cat > deploy/terraform/azure/ ${{ github.event.inputs.environment || inputs.environment || 'staging' }}.tfvars << EOF
6363 environment = "${{ github.event.inputs.environment || inputs.environment || 'staging' }}"
6464 app_image_tag = "${{ github.sha }}"
6565 tenant_id = "${{ secrets.AZURE_TENANT_ID }}"
@@ -69,12 +69,12 @@ jobs:
6969 EOF
7070
7171 - name : Terraform Init
72- working-directory : deploy/terraform/app
72+ working-directory : deploy/terraform/azure/ app
7373 run : |
7474 terraform init
7575
7676 - name : Import existing Terraform resources
77- working-directory : deploy/terraform/app
77+ working-directory : deploy/terraform/azure/ app
7878 run : |
7979 # Check if resource exists in state, import if not
8080 if ! terraform state show 'module.app.azurerm_user_assigned_identity.openai_identity_sa' &>/dev/null; then
@@ -134,10 +134,10 @@ jobs:
134134 id : terraform_plan
135135 uses : dflook/terraform-plan@v1
136136 with :
137- path : deploy/terraform/app
138- var_file : deploy/terraform/${{ github.event.inputs.environment || inputs.environment || 'staging' }}.tfvars
137+ path : deploy/terraform/azure/ app
138+ var_file : deploy/terraform/azure/ ${{ github.event.inputs.environment || inputs.environment || 'staging' }}.tfvars
139139
140140 - name : Terraform Apply
141141 if : inputs.auto_apply
142- working-directory : deploy/terraform/app
142+ working-directory : deploy/terraform/azure/ app
143143 run : terraform apply -auto-approve -var-file="../${{ github.event.inputs.environment || inputs.environment || 'staging' }}.tfvars"
0 commit comments