Skip to content

run-terraform

run-terraform #3

Workflow file for this run

name: run-terraform
on:
workflow_dispatch:
inputs:
arguments:
description: "Terraform CLI arguments"
required: true
default: "apply -auto-approve"
defaults:
run:
shell: bash
jobs:
terraform:
name: terraform
runs-on: ubuntu-latest
env:
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_IN_AUTOMATION: true
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout/releases/tag/v5.0.0
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 https://github.com/hashicorp/setup-terraform/releases/tag/v3.1.2
with:
terraform_version: "1.11.4"
terraform_wrapper: false
- name: Sops Binary Installer
uses: mdgreenwald/mozilla-sops-action@v1.6.0
- name: Descrypt config.yaml
run: sops -d -i config.yaml
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
- name: Terraform Init
run: terraform init -input=false
- name: Terraform + Custom Inputs
run: terraform ${{ inputs.arguments }} -input=false