try caching terraform
All checks were successful
Terraform validate and apply / nix (ubuntu-latest) (push) Successful in 2m49s
All checks were successful
Terraform validate and apply / nix (ubuntu-latest) (push) Successful in 2m49s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
name: Terraform validate and apply
|
||||
run-name: ${{ gitea.actor }} applying terraform
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@@ -8,9 +8,9 @@ env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
|
||||
TF_VAR_aws_region: ${{ vars.TF_VAR_aws_region }}
|
||||
TF_VAR_site_domain: ${{ vars.TF_VAR_site_domain }}
|
||||
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
|
||||
jobs:
|
||||
nix:
|
||||
strategy:
|
||||
@@ -24,6 +24,15 @@ jobs:
|
||||
- run: ls
|
||||
- name: Set up terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
- name: Set up and configure Terraform plugin cache
|
||||
run: |
|
||||
mkdir --parents $TF_PLUGIN_CACHE_DIR
|
||||
- name: Cache terraform
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.TF_PLUGIN_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-terraform-${{hashFiles('**.terraform.lock.hcl') }}
|
||||
restore-keys: ${{ runner.os }}-terraform-
|
||||
- name: Init
|
||||
id: init
|
||||
run: terraform init
|
||||
@@ -36,4 +45,3 @@ jobs:
|
||||
- name: Plan
|
||||
id: plan
|
||||
run: terraform plan -no-color -input=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user