Terraform deployment #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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##*/} |