Skip to content

Commit

Permalink
Build assets before running terraform plan so the source code hash ma…
Browse files Browse the repository at this point in the history
…tches
  • Loading branch information
rahearn committed Jan 2, 2025
1 parent 4763f9a commit 6d11643
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@ jobs:
- uses: ./.github/actions/setup-languages

- name: Restore asset cache
uses: actions/cache@v4
uses: actions/cache/restore@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
path: public/assets

- name: Terraform apply
uses: dflook/terraform-apply@v1
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/terraform-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ jobs:
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:
Expand Down

0 comments on commit 6d11643

Please sign in to comment.