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
43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: Terraform Apply
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
terraform:
|
|
name: "Terraform Apply"
|
|
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 Plan
|
|
working-directory: terraform
|
|
run: terraform plan
|
|
|
|
- name: Terraform Apply
|
|
working-directory: terraform
|
|
run: terraform apply -auto-approve
|