Skip to content

Use terragrunt to provision infrastructure #1

Use terragrunt to provision infrastructure

Use terragrunt to provision infrastructure #1

Workflow file for this run

name: Infrastructure
concurrency:
cancel-in-progress: false
group: '${{ github.workflow }}'
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
check_secrets:
name: Check secrets
runs-on: ubuntu-latest
strategy:
matrix:
secretName:
- GH_ADMIN_TOKEN
- PG_CONN_STR
- ELEPHANTSQL_APIKEY
- GANDI_KEY
- IMPROVMX_API_TOKEN
steps:
- uses: actions/checkout@v3
- name: "Check: ${matrix.secretName}"
uses: ./.github/actions/check-env-var
with:
env_var: ${{ secrets[matrix.secretName] }}
terragrunt:
name: "Terragrunt"
needs: [check_secrets]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: opentofu/setup-opentofu@v1
- name: Plan
if: github.event_name == 'pull_request' || github.event_name == 'push'
uses: gruntwork-io/terragrunt-action@v2
with:
tf_version: 1.6.0
tg_version: 0.53.0
tg_dir: ./
tg_command: 'plan'
- name: Apply
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
uses: gruntwork-io/terragrunt-action@v2
with:
tf_version: 1.6.0
tg_version: 0.53.0
tg_dir: ./
tg_command: 'apply'