feat: add caching for pnpm store and Terraform providers
This commit is contained in:
parent
dd41de5246
commit
4030dee789
3 changed files with 38 additions and 0 deletions
|
|
@ -49,6 +49,18 @@ runs:
|
|||
with:
|
||||
version: ${{ inputs.pnpm-version }}
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-store
|
||||
shell: bash
|
||||
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache pnpm store
|
||||
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1
|
||||
with:
|
||||
path: ${{ steps.pnpm-store.outputs.path }}
|
||||
key: ${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}-${{ hashFiles(format('{0}/pnpm-lock.yaml', inputs.working-directory)) }}
|
||||
restore-keys: ${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}-
|
||||
|
||||
- name: Configure pnpm registry authentication
|
||||
if: ${{ inputs.jfrog-token != '' }}
|
||||
shell: bash
|
||||
|
|
|
|||
|
|
@ -34,6 +34,19 @@ runs:
|
|||
with:
|
||||
terraform_version: ${{ inputs.terraform-version }}
|
||||
|
||||
- name: Set Terraform plugin cache directory
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.terraform.d/plugin-cache
|
||||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache Terraform providers
|
||||
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1
|
||||
with:
|
||||
path: ~/.terraform.d/plugin-cache
|
||||
key: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-${{ hashFiles(format('{0}/.terraform.lock.hcl', inputs.terraform-dir)) }}
|
||||
restore-keys: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-
|
||||
|
||||
- name: Terraform Init
|
||||
shell: bash
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -30,6 +30,19 @@ runs:
|
|||
with:
|
||||
terraform_version: ${{ inputs.terraform-version }}
|
||||
|
||||
- name: Set Terraform plugin cache directory
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.terraform.d/plugin-cache
|
||||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache Terraform providers
|
||||
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1
|
||||
with:
|
||||
path: ~/.terraform.d/plugin-cache
|
||||
key: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-${{ hashFiles(format('{0}/.terraform.lock.hcl', inputs.terraform-dir)) }}
|
||||
restore-keys: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-
|
||||
|
||||
- name: Terraform Init
|
||||
shell: bash
|
||||
env:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue