Skip to content

fix(ci): fix terraform pipeline #5

fix(ci): fix terraform pipeline

fix(ci): fix terraform pipeline #5

Workflow file for this run

name: 'Terraform'
on:
push:
branches: [ "main" ]
pull_request:
jobs:
terraform:
name: 'Terraform'
runs-on: self-hosted
environment: pve0
env:
PROXMOX_VE_ENDPOINT: ${{vars.PROXMOX_VE_ENDPOINT}}
PROXMOX_VE_INSECURE: ${{vars.PROXMOX_VE_INSECURE}}
PROXMOX_VE_SSH_USERNAME: ${{secrets.PROXMOX_VE_SSH_USERNAME}}
PROXMOX_VE_SSH_PASSWORD: ${{secrets.PROXMOX_VE_SSH_PASSWORD}}
PROXMOX_VE_API_TOKEN: ${{secrets.PROXMOX_VE_API_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Terraform Init
run: terraform init
- name: Terraform Format
run: terraform fmt -check -diff -recursive
- name: Create terraform.tfvars
run: |
cp github-actions.tfvars terraform.tfvars
- name: Terraform Validate
run: terraform validate
- name: Terraform Plan
run: terraform plan -out tfplan
# - name: Terraform Apply
# if: ${{ github.ref == 'refs/heads/main' }}
# run: terraform apply tfplan