Skip to content

Terraform deployment #7

Terraform deployment

Terraform deployment #7

name: Terraform deployment
on:
workflow_dispatch:
jobs:
terraform_deployment:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
runs-on: ubuntu-latest
name: Run terraform
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Terraform
uses: hashicorp/setup-terraform@v3
- name: Initialize Terraform
run: terraform init -backend-config="./${GITHUB_REF##*/}.config" # use branch name as deployment environment
- name: Run Terraform Plan
run: |
terraform plan -var="environment=${GITHUB_REF##*/}"
#- name: Run Terraform Apply
# run: |
# terraform apply -auto-approve -var="environment=${GITHUB_REF##*/}