Skip to content

Commit

Permalink
add :: pluralith
Browse files Browse the repository at this point in the history
  • Loading branch information
Junho-06 committed Dec 21, 2023
1 parent 061e60f commit 32aebe8
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/pluralith.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on: [push]
jobs:
pluralith:
runs-on: ubuntu-latest
env:
working-directory: ./

name: Run Pluralith
steps:
- name: Check out repository
uses: actions/checkout@v2

# Set up AWS credentials (using the aws-actions/configure-aws-credentials action)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ap-northeast-2

# Set up Terraform
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false # This is recommended so the `terraform show` command outputs valid JSON

# Init Terraform project
- name: Terraform Init
run: terraform init
working-directory: "${{ env.working-directory }}"

# Set up and authenticate Pluralith
- name: Pluralith Init
uses: Pluralith/actions/[email protected]
with:
terraform-path: "${{ env.working-directory }}"
api-key: ${{ secrets.PLURALITH_API_KEY }}

# Run Pluralith to generate an infrastructure diagram and comment body
- name: Pluralith Run
uses: Pluralith/actions/[email protected]
with:
terraform-command: "plan"
terraform-path: "${{ env.working-directory }}"
show-changes: true
show-drift: true
show-costs: true # Requires Infracost to be set up in your pipeline

# Post the generated diagram as a GitHub comment
- name: Pluralith Comment
uses: Pluralith/actions/[email protected]
with:
terraform-path: "${{ env.working-directory }}"
target-type: commit

0 comments on commit 32aebe8

Please sign in to comment.