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: