Skip to content

feat: cloudflare iac (#41) #13

feat: cloudflare iac (#41)

feat: cloudflare iac (#41) #13

Workflow file for this run

name: 'Terragrunt'
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
env:
tofu_version: '1.7.1'
tg_version: '0.58.12'
working_dir: 'deployment/modules/cloudflare'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@main
- name: Check Formatting
uses: gruntwork-io/terragrunt-action@v2
with:
tofu_version: ${{ env.tofu_version }}
tg_version: ${{ env.tg_version }}
tg_dir: ${{ env.working_dir }}
tg_command: 'hclfmt --terragrunt-check --terragrunt-diff'
- name: Check terraform fmt
uses: gruntwork-io/terragrunt-action@v2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }}
with:
tofu_version: ${{ env.tofu_version }}
tg_version: ${{ env.tg_version }}
tg_dir: ${{ env.working_dir }}
tg_command: 'run-all fmt -diff -check'
plan:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@main
- name: Plan All
id: plan
uses: gruntwork-io/terragrunt-action@v2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tofu_version: ${{ env.tofu_version }}
tg_version: ${{ env.tg_version }}
tg_dir: ${{ env.working_dir }}
tg_command: 'run-all plan'
tg_comment: 1
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: 'Checkout'
uses: actions/checkout@main
- name: Deploy All
uses: gruntwork-io/terragrunt-action@v2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }}
with:
tofu_version: ${{ env.tofu_version }}
tg_version: ${{ env.tg_version }}
tg_dir: ${{ env.working_dir }}
tg_command: 'run-all apply'