From 787320c8b5b385aca3c6668cd426994ac498321e Mon Sep 17 00:00:00 2001 From: LionelL Date: Thu, 12 Oct 2023 10:06:19 +0200 Subject: [PATCH 1/2] ci: create infra pipeline --- .github/workflows/infra.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/infra.yml diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml new file mode 100644 index 0000000..b2f44d2 --- /dev/null +++ b/.github/workflows/infra.yml @@ -0,0 +1,43 @@ +on: + workflow_dispatch: + pull_request: + branches: ["main"] + paths: ["infra"] + paths-ignore: ["infra/.azure-pipelines"] + push: + branches: ["main"] + paths: ["infra"] + paths-ignore: ["infra/.azure-pipelines"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Install TF + uses: hashicorp/setup-terraform@v2.0.3 + with: + terraform_version: latest + + - name: Initialize TF + run: terraform init --backend-config=${{ secrets.TF_BACKEND }} + working-directory: 'infra/provisioning' + + - name: Validate TF + run: terraform validate --backend-config=${{ secrets.TF_BACKEND }} + working-directory: 'infra/provisioning' + + - name: Plan TF + uses: Pwd9000-ML/terraform-azurerm-plan@v1.2.6 + with: + path: 'infra/provisioning' + tf_vars_file: ${{ secrets.TF_VARS }} + az_resource_group: '' + az_container_name: '' + + - name: Apply TF + uses: Pwd9000-ML/terraform-azurerm-apply@v1.2.6 + if: github.event_name != 'pull_request' + with: + az_resource_group: '' + az_container_name: '' From a95b8962fbbd2d2bf679be42785231fc97928852 Mon Sep 17 00:00:00 2001 From: LionelL Date: Thu, 12 Oct 2023 10:08:16 +0200 Subject: [PATCH 2/2] ci: update infra pipeline --- .github/workflows/infra.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml index b2f44d2..f5a13e1 100644 --- a/.github/workflows/infra.yml +++ b/.github/workflows/infra.yml @@ -3,11 +3,9 @@ on: pull_request: branches: ["main"] paths: ["infra"] - paths-ignore: ["infra/.azure-pipelines"] push: branches: ["main"] paths: ["infra"] - paths-ignore: ["infra/.azure-pipelines"] jobs: build: