Some checks failed
Terraform Plan / Terraform Plan (push) Failing after 14s
- Generate secrets.auto.tfvars file during workflow run - Terraform automatically loads *.auto.tfvars files - This bypasses any issues with TF_VAR_ environment variables
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Terraform Plan
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- stage
|
|
- test
|
|
|
|
jobs:
|
|
terraform:
|
|
name: "Terraform Plan"
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create secrets.tfvars
|
|
working-directory: terraform
|
|
run: |
|
|
cat > secrets.auto.tfvars << EOF
|
|
pm_api_token_id = "${{ secrets.PM_API_TOKEN_ID }}"
|
|
pm_api_token_secret = "${{ secrets.PM_API_TOKEN_SECRET }}"
|
|
SSH_KEY_PUBLIC = "${{ secrets.SSH_KEY_PUBLIC }}"
|
|
TS_AUTHKEY = "${{ secrets.TS_AUTHKEY }}"
|
|
EOF
|
|
|
|
- name: Set up Terraform
|
|
uses: hashicorp/setup-terraform@v2
|
|
with:
|
|
terraform_version: 1.6.6
|
|
|
|
- name: Terraform Init
|
|
working-directory: terraform
|
|
run: terraform init
|
|
|
|
- name: Terraform Format Check
|
|
working-directory: terraform
|
|
run: terraform fmt -check -recursive
|
|
|
|
- name: Terraform Validate
|
|
working-directory: terraform
|
|
run: terraform validate
|
|
|
|
- name: Terraform Plan
|
|
working-directory: terraform
|
|
run: terraform plan -out=tfplan
|
|
|
|
- name: Upload Terraform Plan
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: terraform-plan
|
|
path: terraform/tfplan
|