hcornet 7d1a34e24e
Some checks failed
terraform validation / Terraform (push) Has been cancelled
test
2025-01-23 21:07:46 +01:00

60 lines
1.4 KiB
YAML

name: terraform validation
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
validate:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.7.5
- name: Set up GCloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
version: '>= 506.0.0'
- name: 'Use GCloud CLI'
run: 'gcloud info'
- name: Authenticate with Google Cloud Platform
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Terraform fmt
id: fmt
run: terraform fmt -check -diff -recursive
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
# working-directory: examples
- name: Terraform Validate
id: validate
run: terraform validate
# working-directory: examples
- name: Terraform Plan
id: plan
run: terraform plan
- name: Terraform Apply
id: apply
run: terraform apply -auto-approve