Skip to content

Use terragrunt to provision infrastructure #9

Use terragrunt to provision infrastructure

Use terragrunt to provision infrastructure #9

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
- uses: ./.github/actions/check-env-var
with:
version: '0.53.4'
- name: Plan
if: github.event_name == 'pull_request' || github.event_name == 'push'
working-directory: stages
run: terragrunt run-all plan
- name: Apply
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
working-directory: stages
run: terragrunt run-all apply