Files
tuffas/.gitea/workflows/apply-master.yaml
Deepak Mallubhotla 9bd7003589
All checks were successful
Terraform validate and apply / nix (ubuntu-latest) (push) Successful in 6m57s
test a change for workflow
2025-09-10 13:10:19 -05:00

48 lines
1.4 KiB
YAML

name: Terraform validate and apply
run-name: ${{ gitea.actor }} applying terraform
on:
push:
branches:
- master
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:
fail-fast: true
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: ls -alh
- 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
- name: Check formatting
id: fmt
run: terraform fmt -check
- name: Validate
id: validate
run: terraform validate
- name: Plan
id: plan
run: terraform plan -no-color -input=false