From 0c3eebb27447c15da03ce012f1a825c9ec9184eb Mon Sep 17 00:00:00 2001 From: Ana Calva Date: Wed, 20 Mar 2024 14:16:04 +0100 Subject: [PATCH] Updated workflow --- .github/workflows/release-terraform.yaml | 13 ++++++++++++- .github/workflows/vm-creation-terraform.yaml | 18 +++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-terraform.yaml b/.github/workflows/release-terraform.yaml index bfcd80d..2a6eff2 100644 --- a/.github/workflows/release-terraform.yaml +++ b/.github/workflows/release-terraform.yaml @@ -33,4 +33,15 @@ jobs: release-message: "${{ github.event.inputs.release-message }}" environment-name: k8s runs-on: arc-runner-scale-set-proxmox-vm - continue-error: false \ No newline at end of file + continue-error: false + + VM-Creation-Terraform: + if: github.event.ref == 'refs/heads/main' + name: VM-Creation + needs: Release-Terraform + uses: stuttgart-things/stuttgart-things/.github/workflows/vm-creation-terraform.yaml@main + with: + module-name: proxmox-vm + environment-name: k8s + runs-on: arc-runner-scale-set-proxmox-vm + continue-error: false diff --git a/.github/workflows/vm-creation-terraform.yaml b/.github/workflows/vm-creation-terraform.yaml index 39c059d..1cdbd2f 100644 --- a/.github/workflows/vm-creation-terraform.yaml +++ b/.github/workflows/vm-creation-terraform.yaml @@ -7,6 +7,8 @@ on: - feature/* - review/* - fix/* + pull_request: + types: [opened, reopened] env: pve_api_url: ${{ secrets.PVE_API_URL }} @@ -18,9 +20,8 @@ env: jobs: - job_1: - runs-on: self-hosted - + build-terraform-file: + runs-on: arc-runner-scale-set-proxmox-vm steps: - uses: actions/checkout@v4 @@ -44,10 +45,9 @@ jobs: path: main.tf - job_2: - - needs: job_1 - runs-on: self-hosted + test-terraform-apply: + needs: build-terraform-file + runs-on: arc-runner-scale-set-proxmox-vm steps: - uses: actions/checkout@v4 @@ -82,8 +82,8 @@ jobs: cleanup: if: ${{ always() }} - needs: job_2 - runs-on: self-hosted + needs: test-terraform-apply + runs-on: arc-runner-scale-set-proxmox-vm steps: - uses: actions/checkout@v4