Skip to content

Bump egress_space::terraform-cloudgov from 2.0.0 to 2.0.2 in /terraform #153

Bump egress_space::terraform-cloudgov from 2.0.0 to 2.0.2 in /terraform

Bump egress_space::terraform-cloudgov from 2.0.0 to 2.0.2 in /terraform #153

name: Run Terraform plan in staging
on:
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
jobs:
build-assets:
name: Compile and clean assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile assets
uses: ./.github/actions/compile-assets
with:
rails_env: staging
# you may want to enable the next line to surface issues with missing assets,
# but not until after you've deployed once and the cache has been created
# fail_on_missing_cache: true
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: staging-assets
path: public/assets
terraform:
name: Terraform plan
runs-on: ubuntu-latest
needs: build-assets
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
- name: Download assets
uses: actions/download-artifact@v4
with:
name: staging-assets
path: public/assets
- 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
add_github_comment: changes-only
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
# Uncomment this step if you need to debug issues
# with mismatched app checksum between plan and apply
# - name: Save app zip for debugging
# uses: actions/upload-artifact@v4
# with:
# name: app-src-plan
# path: terraform/dist/src.zip
# compression-level: 0
# retention-days: 1