2025-10-26 11:42:08 +01:00
|
|
|
name: Tofu Plan
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [ main ]
|
|
|
|
|
push:
|
|
|
|
|
branches-ignore:
|
|
|
|
|
- main
|
|
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
tofu:
|
2025-10-26 11:43:44 +01:00
|
|
|
runs-on: docker
|
2025-10-26 11:42:08 +01:00
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
|
run:
|
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
2025-10-26 11:47:26 +01:00
|
|
|
- name: Setup OpenTofu
|
2025-10-26 11:53:13 +01:00
|
|
|
uses: opentofu/setup-opentofu@v1
|
2025-10-26 11:42:08 +01:00
|
|
|
|
2025-10-26 11:47:26 +01:00
|
|
|
- name: Tofu Format Check
|
2025-10-26 12:00:11 +01:00
|
|
|
working-directory: pve01.wheatley.in/k8s-wheatley
|
|
|
|
|
run: tofu fmt -check
|
2025-10-26 11:42:08 +01:00
|
|
|
|
2025-10-26 11:47:26 +01:00
|
|
|
- name: Tofu Init
|
2025-10-26 12:00:11 +01:00
|
|
|
working-directory: pve01.wheatley.in/k8s-wheatley
|
2025-10-26 11:47:26 +01:00
|
|
|
run: tofu init -backend=false
|
2025-10-26 11:42:08 +01:00
|
|
|
|
2025-10-26 11:47:26 +01:00
|
|
|
- name: Tofu Validate
|
2025-10-26 12:00:11 +01:00
|
|
|
working-directory: pve01.wheatley.in/k8s-wheatley
|
2025-10-26 11:47:26 +01:00
|
|
|
run: tofu validate
|
2025-10-26 11:42:08 +01:00
|
|
|
|
2025-10-26 11:47:26 +01:00
|
|
|
- name: Tofu Plan
|
2025-10-26 11:42:08 +01:00
|
|
|
env:
|
|
|
|
|
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
|
|
|
|
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
2025-10-26 12:00:11 +01:00
|
|
|
working-directory: pve01.wheatley.in/k8s-wheatley
|
2025-10-26 11:47:26 +01:00
|
|
|
run: tofu plan -out=tfplan
|
2025-10-26 12:03:26 +01:00
|
|
|
|
|
|
|
|
- name: Tofu Apply
|
|
|
|
|
env:
|
|
|
|
|
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
|
|
|
|
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
|
|
|
|
working-directory: pve01.wheatley.in/k8s-wheatley
|
|
|
|
|
run: tofu apply -auto-approve tfplan
|