Deploy Postgres database to K8s via IaC #4
This file contains hidden or 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 Plan | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| plan: | |
| name: Plan | |
| runs-on: ubuntu-latest | |
| environment: prod | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./environments/prod # TODO different paths for target env | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Setup Terraform | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: "v1.12.2" | |
| # Configure aws creds | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-region: us-west-1 | |
| role-to-assume: arn:aws:iam::691595548805:role/github_actions_full_admin | |
| - name: Terraform init | |
| id: init | |
| run: terraform init | |
| - name: Terraform Format Check | |
| run: terraform fmt -check | |
| - name: Terraform Validate | |
| run: terraform validate | |
| - name: Terraform Plan | |
| run: terraform plan -no-color | |
| continue-on-error: true | |
| id: plan | |
| env: | |
| DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
| - name: Comment Plan on PR | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| message: | | |
| ### Terraform Plan Result | |
| ``` | |
| ${{ steps.plan.outputs.stdout }} | |
| ``` |