diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index cfc11b2..17b7ace 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -14,7 +14,11 @@ jobs: terraform: name: 'Terraform' runs-on: ubuntu-latest - + strategy: + matrix: + directory: [001_vnet_subnets_tf, 002_vm_bastion] +# node: [14, 16] + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest defaults: run: @@ -46,22 +50,22 @@ jobs: # Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. - name: Terraform Init - run: terraform -chdir=001_vnet_subnets_tf init + run: terraform -chdir=${{ matrix.directory }} init # Checks that all Terraform configuration files adhere to a canonical format - name: Terraform Format - run: terraform -chdir=001_vnet_subnets_tf fmt -check + run: terraform -chdir=${{ matrix.directory }} fmt -check # Generates an execution plan for Terraform - name: Terraform Plan - run: terraform -chdir=001_vnet_subnets_tf plan -out tfplan + run: terraform -chdir=${{ matrix.directory }} plan -out tfplan # On push to "main", build or change infrastructure according to Terraform configuration files # Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks - name: Terraform Apply - run: terraform -chdir=001_vnet_subnets_tf apply tfplan + run: terraform -chdir=${{ matrix.directory }} apply tfplan # if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' # Terraform Destroy - name: Terraform Destroy - run: terraform -chdir=001_vnet_subnets_tf destroy -auto-approve -input=false + run: terraform -chdir=${{ matrix.directory }} destroy -auto-approve -input=false