Update README.md #96
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' | |
defaults: | |
run: | |
shell: bash | |
working-directory: CHAP12/cert/ | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
terraform: | |
runs-on: ubuntu-latest | |
name: Terraform | |
environment: dev | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install terraform-plan-summary | |
run: | | |
REPO="dineshba/terraform-plan-summary" | |
curl -LO https://github.com/$REPO/releases/latest/download/tf-summarize_linux_amd64.zip | |
tmpDir=$(mktemp -d -t tmp.XXXXXXXXXX) | |
mv tf-summarize_linux_amd64.zip $tmpDir | |
cd $tmpDir | |
unzip tf-summarize_linux_amd64.zip | |
chmod +x tf-summarize | |
echo $PWD >> $GITHUB_PATH | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.4.6 | |
terraform_wrapper: false | |
- name: Terraform Init | |
id: init | |
run: terraform init | |
- name: Terraform Plan | |
id: plan | |
run: terraform plan -input=false -no-color -out tf.plan | |
- name: summary in draw table format | |
run: | | |
rm -rf tf-summarize-table-output.md | |
terraform show -json tf.plan | tf-summarize -md > tf-summarize-table-output.md | |
- name: Adding markdown | |
run: | | |
cat tf-summarize-table-output.md > $GITHUB_STEP_SUMMARY | |
- name: Terraform Apply | |
run: terraform apply -input=false tf.plan | |