diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml deleted file mode 100644 index 1997a4a..0000000 --- a/.gitea/workflows/deploy.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Terraform Deploy - -on: - workflow_run: - workflows: ["plan.yaml"] - types: - - completed - branches: - - main - -env: - TF_IN_AUTOMATION: true - TF_CLI_ARGS: "-no-color" - -jobs: - apply: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: hashicorp/setup-terraform@v3 - - name: Terraform apply - id: apply - run: terraform apply -auto-approve tfplan diff --git a/.gitea/workflows/plan.yaml b/.gitea/workflows/plan-and-apply.yaml similarity index 89% rename from .gitea/workflows/plan.yaml rename to .gitea/workflows/plan-and-apply.yaml index 03c7058..fb2e012 100644 --- a/.gitea/workflows/plan.yaml +++ b/.gitea/workflows/plan-and-apply.yaml @@ -1,4 +1,4 @@ -name: Terraform Plan +name: Terraform Plan and Apply on: pull_request: @@ -87,3 +87,13 @@ jobs: body: output }) } + apply: + runs-on: ubuntu-latest + needs: plan + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - uses: hashicorp/setup-terraform@v3 + - name: Terraform apply + id: apply + run: terraform apply -auto-approve tfplan