From 79db1e1f200c40be5e40b7b2d8be3283064f2ae8 Mon Sep 17 00:00:00 2001 From: Kresimir Sutalo Date: Mon, 23 Sep 2024 13:32:14 +0200 Subject: [PATCH] debug: pipeline --- .github/workflows/terraform.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 9c023d7..9d13b54 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -57,17 +57,6 @@ jobs: with: terraform_version: 1.9.5 - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - working-directory: ${{ github.event.inputs.directory }} - - run: | - python -m venv venv - ls -lah venv/bin - source venv/bin/activate - pip install -r requirements.txt - working-directory: ${{ github.event.inputs.directory }} - - name: 'Terraform Init' if: github.event.inputs.directory != '' working-directory: ${{ github.event.inputs.directory }} @@ -112,6 +101,11 @@ jobs: terraform plan -target=module.${{ github.event.inputs.module }} -out main.tfplan fi + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + working-directory: ${{ github.event.inputs.directory }} - name: 'Terraform apply' if: | github.event.inputs.action == 'apply' && @@ -125,6 +119,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }} GITHUB_OWNER: ${{ vars.GH_OWNER }} run: | + python -m venv venv + source venv/bin/activate + which python + pip install -r requirements.txt terraform apply -auto-approve main.tfplan - name: 'Terraform destroy'