diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 3e06083c1..42e3863c9 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -16,6 +16,9 @@ on: client_machine_type: required: true +env: + TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache + jobs: deploy: name: Deploy @@ -36,19 +39,14 @@ jobs: with: terraform_version: 1.1.9 - - name: Config Terraform plugin cache - run: | - echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc - mkdir --parents ~/.terraform.d/plugin-cache + - name: Create Terraform Plugin Cache Dir + run: mkdir --parents $TF_PLUGIN_CACHE_DIR - name: Cache Terraform uses: actions/cache@v3 with: - path: | - ~/.terraform.d/plugin-cache + path: ${{ env.TF_PLUGIN_CACHE_DIR }} key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} - restore-keys: | - ${{ runner.os }}-terraform- - name: Init Terraform run: make init @@ -57,7 +55,7 @@ jobs: run: make apply env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CLIENT_CLUSTER_SIZE: ${{ secrets.client_cluster_size }} CLIENT_MACHINE_TYPE: ${{ secrets.client_machine_type }} - SERVER_CLUSTER_SIZE: ${{ secrets.server_cluster_size }} + CLIENT_CLUSTER_SIZE: ${{ secrets.client_cluster_size }} SERVER_MACHINE_TYPE: ${{ secrets.server_machine_type }} + SERVER_CLUSTER_SIZE: ${{ secrets.server_cluster_size }}