Skip to content

last chage on pipeline #20

last chage on pipeline

last chage on pipeline #20

Workflow file for this run

name: Terraform CI/CD
env:
TF_LOG: TRACE
on:
push:
branches:
- develop
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: latest
- name: Terraform Init
run: terraform init -reconfigure -upgrade
- name: Terraform Validate
run: terraform validate
plan:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: latest
- name: Terraform Plan
run: terraform plan -out=plan
- name: Archive Plan
uses: actions/upload-artifact@v2
with:
name: plan
path: plan
if-no-files-found: error
# apply:
# runs-on: ubuntu-latest
# needs: plan
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Set up Terraform
# uses: hashicorp/setup-terraform@v1
# with:
# terraform_version: latest
# - name: Terraform Apply
# run: terraform apply --auto-approve plan
# destroy:
# runs-on: ubuntu-latest
# needs: apply
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Set up Terraform
# uses: hashicorp/setup-terraform@v1
# with:
# terraform_version: latest
# - name: Terraform Destroy
# run: terraform apply -destroy --auto-approve