Skip to content

Commit

Permalink
Test .terraform caching
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha committed Jul 25, 2024
1 parent 784d3c4 commit 421f626
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ runs:
role-session-name: "atmos-terraform-plan-gitops"
mask-aws-account-id: "no"

- name: Restore .terraform from cache
- name: Cache .terraform
id: cache-restore
uses: actions/cache/restore@v4
uses: actions/cache@v4
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' }}
with:
path: |
Expand Down Expand Up @@ -282,33 +282,6 @@ runs:
rm -f ${TERRAFORM_OUTPUT_FILE}
- name: Install gh
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' }}
uses: jaxxstorm/[email protected]
with:
repo: cli/cli
tag: v2.53.0

- name: clear
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' && steps.cache-restore.outputs.cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ steps.cache-restore.outputs.cache-primary-key }} --confirm
continue-on-error: true

- name: Cache .terraform
id: cache-save
uses: actions/cache/save@v4
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' }}
with:
path: |
./${{ steps.vars.outputs.component_path }}/.terraform/modules
./${{ steps.vars.outputs.component_path }}/.terraform/providers
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

- name: Configure State AWS Credentials
if: ${{ steps.atmos-plan.outputs.error == 'false' }}
uses: aws-actions/[email protected]
Expand Down

0 comments on commit 421f626

Please sign in to comment.