From 44e45a0f3d00a98e9bb5fae093ff74b045d8f723 Mon Sep 17 00:00:00 2001 From: Tellsanguis Date: Fri, 7 Nov 2025 10:27:09 +0100 Subject: [PATCH] =?UTF-8?q?feat(ci):=20Impl=C3=A9mentation=20workflow=20Te?= =?UTF-8?q?rraform=20multi-modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/ci.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 8d40d6f..11e6ed4 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -27,17 +27,27 @@ jobs: - name: Terraform Validate run: | - cd terraform - tofu init -backend=false - tofu validate + for dir in terraform/pve*; do + if [ -d "$dir" ]; then + echo "--- Validating $dir ---" + (cd "$dir" && tofu init -backend=false && tofu validate) + fi + done - name: Terraform Plan if: github.event_name == 'push' run: | - cd terraform - cp terraform.tfvars.example terraform.tfvars - tofu init - tofu plan -out=tfplan + for dir in terraform/pve*; do + if [ -d "$dir" ]; then + echo "--- Planning $dir ---" + ( + cd "$dir" && \ + cp ../terraform.tfvars.example terraform.tfvars && \ + tofu init && \ + tofu plan -out="tfplan-$(basename $dir)" + ) + fi + done env: TF_VAR_proxmox_token_id: ${{ secrets.PROXMOX_TOKEN_ID }} TF_VAR_proxmox_token_secret: ${{ secrets.PROXMOX_TOKEN_SECRET }} @@ -48,8 +58,8 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: - name: tfplan - path: terraform/tfplan + name: tfplans + path: terraform/pve*/tfplan-* retention-days: 1 ci-ansible: