From 77a9a49c063bd84dda01fc9ca44b750fa0979d3d Mon Sep 17 00:00:00 2001
From: Marcus Weiner <marcus.weiner@gmail.com>
Date: Mon, 26 Aug 2024 23:49:24 +0200
Subject: [PATCH] Make terraform workflow domain specific

---
 .github/workflows/terraform.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/terraform.yaml b/.github/workflows/terraform.yaml
index 48c4e5f..e4ad2f3 100644
--- a/.github/workflows/terraform.yaml
+++ b/.github/workflows/terraform.yaml
@@ -9,17 +9,21 @@ jobs:
   run:
     name: Run
     runs-on: ubuntu-22.04
+    strategy:
+      matrix:
+        domain: ["dev"]
     concurrency:
-      group: terraform
+      group: terraform-${{ matrix.domain }}
       cancel-in-progress: false
     permissions:
       contents: read
       pull-requests: write
       checks: write
     env:
+      TF_HTTP_USERNAME: ffddorf/supernodes-v2@${{ matrix.domain }}
       TF_HTTP_PASSWORD: ${{ github.token }}
       TF_IN_AUTOMATION: "true"
-      TF_CLI_ARGS: "-input=false"
+      TF_CLI_ARGS: "-input=false -var-file=domains/${{ matrix.domain }}.tfvars"
       NETBOX_API_TOKEN: ${{ secrets.NETBOX_API_TOKEN }}
       PM_API_TOKEN_ID: ${{ secrets.PM_API_TOKEN_ID }}
       PM_API_TOKEN_SECRET: ${{ secrets.PM_API_TOKEN_SECRET }}