Skip to content

Commit

Permalink
refactor(terraform): pass plugin cache dir through output
Browse files Browse the repository at this point in the history
  • Loading branch information
hknutsen committed Nov 19, 2024
1 parent b6a598e commit d639e42
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
outputs:
upload-outcome: ${{ steps.upload.outcome }}
artifact-id: ${{ steps.upload.outputs.artifact-id }}
plugin-cache-dir: ${{ steps.mkdir.outputs.plugin-cache-dir }}
cache-primary-key: ${{ steps.cache-restore.outputs.cache-primary-key }}

steps:
Expand Down Expand Up @@ -299,17 +300,10 @@ jobs:
gpg -d --batch --passphrase "$ENCRYPTION_PASSWORD" "$tarball" | tar -xv
rm "$tarball"
- name: Create Terraform plugin cache
id: mkdir
run: |
plugin_cache_dir="$HOME/.terraform.d/plugin-cache"
mkdir --parents "$plugin_cache_dir"
echo "plugin-cache-dir=$plugin_cache_dir" >> "$GITHUB_OUTPUT"
- name: Restore cache
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: ${{ steps.mkdir.outputs.plugin-cache-dir }}
path: ${{ needs.terraform-plan.outputs.plugin-cache-dir }}
key: ${{ needs.terraform-plan.outputs.cache-primary-key }}

- name: Terraform Apply
Expand Down

0 comments on commit d639e42

Please sign in to comment.