Clean zipcode page #10
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: "PR checks" | |
on: | |
pull_request: | |
env: | |
TF_CLOUD_ORGANIZATION: "${{secrets.ORGANIZATION_TF}}" | |
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | |
TF_WORKSPACE: "PROD-zwell-calculator" | |
CONFIG_DIRECTORY: "./terraform/" | |
jobs: | |
# Add jobs in to run checks | |
# linting | |
# unit test | |
terraform: | |
name: "tf plan devtest" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# uploads/initiates a configuration in terraform | |
# akin to terraform init | |
- name: Upload Configuration | |
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.2.0 | |
id: plan-upload | |
with: | |
workspace: ${{ env.TF_WORKSPACE }} | |
directory: ${{ env.CONFIG_DIRECTORY }} | |
speculative: true | |
# runs changes in terrafrom/ against current state to create a tf.plan | |
# tarraform plan | |
- name: Create Plan Run | |
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.2.0 | |
id: plan-run | |
with: | |
workspace: ${{ env.TF_WORKSPACE }} | |
configuration_version: ${{ steps.plan-upload.outputs.configuration_version_id }} | |
plan_only: true | |
# uncomment to tear down aws infra | |
# is_destroy: true | |
# Gets the plan and logs it in pipeline for debugging | |
- name: Get Plan Output | |
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.2.0 | |
id: plan-output | |
with: | |
plan: ${{ fromJSON(steps.plan-run.outputs.payload).data.relationships.plan.data.id }} | |