Skip to content

Remove auto-approve #129

Remove auto-approve

Remove auto-approve #129

name: Run Terraform plan in staging
on:
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
jobs:
terraform:
name: Terraform plan
runs-on: ubuntu-24.04
environment: staging
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: terraform validate
uses: dflook/terraform-validate@v1
with:
path: terraform
- name: terraform fmt
uses: dflook/terraform-fmt-check@v1
with:
path: terraform
# - uses: ./.github/actions/setup-languages
# - name: Use asset cache
# uses: actions/cache@v4
# with:
# key: cache-staging-assets
# path: public/assets
# - name: Precompile assets and clean old versions
# env:
# RAILS_ENV: staging
# SECRET_KEY_BASE_DUMMY: 1
# run: ./bin/rake assets:precompile && ./bin/rake assets:clean
- name: terraform plan
uses: dflook/terraform-plan@v1
env:
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
TF_VAR_rails_master_key: ${{ secrets.RAILS_MASTER_KEY }}
TERRAFORM_PRE_RUN: |
apt-get update
apt-get install -y zip
with:
path: terraform
var_file: terraform/staging.tfvars
backend_config: >
access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
bucket=${{ secrets.TERRAFORM_STATE_BUCKET_NAME }}
key=terraform.tfstate.staging