Skip to content

Merge branch 'main' of https://github.com/HTTPArchive/dataform #4

Merge branch 'main' of https://github.com/HTTPArchive/dataform

Merge branch 'main' of https://github.com/HTTPArchive/dataform #4

Workflow file for this run

name: Terraform Apply on Changes
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v3
with:
project_id: "httparchive"
credentials_json: ${{ env.GCP_SA_KEY }}
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3.1.2
- name: Terraform Format Check
working-directory: ./infra
run: terraform fmt -check
- name: Initialize Terraform
working-directory: ./infra
run: terraform init
- name: Validate Terraform
working-directory: ./infra
run: terraform validate
- name: Plan Terraform
working-directory: ./infra
run: terraform plan -out=tfplan
- name: Apply Terraform
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
working-directory: ./infra
run: terraform apply -auto-approve tfplan