Skip to content

terraform deploy

terraform deploy #4

Workflow file for this run

name: terraform deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Target environment (dev, prod)'
required: true
default: 'dev'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.10.3
- name: Terraform Init and Apply
working-directory: terraform/environments/${{ github.event.inputs.environment }}
env:
TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }}
run: |
terraform init
terraform plan -out=tfplan
terraform apply tfplan