feat: execute terraform workflow
This commit is contained in:
42
.gitea/workflows/opdracht-3.yaml
Normal file
42
.gitea/workflows/opdracht-3.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
name: Terraform Provision
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- opdracht-3/**/*.tf
|
||||
- opdracht-3/**/*.tfvars
|
||||
- opdracht-3/**/*.tftpl
|
||||
|
||||
jobs:
|
||||
terraform:
|
||||
name: Terraform Apply
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
TF_VAR_esxi_hostname: ${{ secrets.ESXI_HOSTNAME }}
|
||||
TF_VAR_esxi_username: ${{ secrets.ESXI_USERNAME }}
|
||||
TF_VAR_esxi_password: ${{ secrets.ESXI_PASSWORD }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
|
||||
- name: Terraform Init
|
||||
run: terraform init
|
||||
|
||||
- name: Terraform Format
|
||||
run: terraform fmt -check
|
||||
|
||||
- name: Terraform Validate
|
||||
run: terraform validate
|
||||
|
||||
- name: Terraform Plan
|
||||
run: terraform plan
|
||||
|
||||
- name: Terraform Apply
|
||||
run: terraform apply -auto-approve
|
Reference in New Issue
Block a user