diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index 884819c..2bed9a6 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -17,13 +17,3 @@ jobs: environment_name: test version_number: ${{ github.run_id }} secrets: inherit - - terraform: - if: ${{ needs.changes.outputs.infrastructure == 'true' }} - name: terraform-plan - needs: - - changes - uses: ./.gitea/workflows/terraform.yaml - with: - environment_name: test - secrets: inherit diff --git a/.gitea/workflows/terraform.yaml b/.gitea/workflows/terraform.yaml index 6eb7ef3..c8630e0 100644 --- a/.gitea/workflows/terraform.yaml +++ b/.gitea/workflows/terraform.yaml @@ -1,6 +1,6 @@ name: 'Terraform' on: - workflow_call: + workflow_dispatch: inputs: environment_name: type: string @@ -31,15 +31,14 @@ jobs: - name: Terraform init run: | - terraform -chdir=./infrastructure init -reconfigure -backend-config="${{ inputs.environment_name }}.backend.tfvars" -input=false + terraform -chdir=./infrastructure init -reconfigure -backend-config="./backend/${{ inputs.environment_name }}.backend.tfvars" -input=false - name: Terraform plan - if: ${{ github.event_name == 'pull_request' }} run: | terraform -chdir=./infrastructure plan -no-color -input=false - - name: Terraform apply - if: ${{ github.event_name != 'pull_request' }} - run: | - terraform -chdir=./infrastructure apply -no-color -input=false + # - name: Terraform apply + # if: ${{ github.event_name != 'pull_request' }} + # run: | + # terraform -chdir=./infrastructure apply -no-color -input=false \ No newline at end of file diff --git a/infrastructure/prod.backend.tfvars b/infrastructure/backend/prod.backend.tfvars similarity index 100% rename from infrastructure/prod.backend.tfvars rename to infrastructure/backend/prod.backend.tfvars diff --git a/infrastructure/test.backend.tfvars b/infrastructure/backend/test.backend.tfvars similarity index 100% rename from infrastructure/test.backend.tfvars rename to infrastructure/backend/test.backend.tfvars